On Sun, 2013-05-19 at 18:32 -0400, Rik van Riel wrote:
> > 
> > One fix would be a loop in do_smart_update():
> > - first check the global queue
> > - then the per-semaphore queues
> > - if one of the per-semaphore queues made progress: check the global 
> > queue again
> > - if the global queue made progress: check the per semaphore queues again
> > ...
> 
> Would that be as simple as making do_smart_update() loop back to
> the top if update_queue on a single semaphore's queue returns
> a non-zero value (something was changed), and there are complex
> operations pending?

I've been looking at the code for a while and this approach seems quite
reasonable. I'd still like Manfred's feedback though. I ran pgbench and
your semop-multi program, nothing suspicious.

> ---8<---
> 
> Subject: ipc,sem: move restart loop to do_smart_update
> 
> A complex operation may be sleeping on a semaphore to become
> a certain value. A sleeping simple operation may turn the
> semaphore into that value.
> 
> Having the restart loop inside update_queue means we may be
> missing the complex operation (which lives on a different
> queue), and result in a semaphore lockup.
> 
> The lockup can be avoided by moving the restart loop into
> do_smart_update, so the list of pending complex operations
> will also be checked if required.
> 
> Signed-off-by: Rik van Riel <r...@redhat.com>
> Reported-by: Manfred Spraul <manf...@colorfullife.com>

Acked-by: Davidlohr Bueso <davidlohr.bu...@hp.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to