Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604359 > unrolled thread

Re: [PATCH] sched: Wake up all non-exclusive waiters in __wake_up_common()

Started byPeter Zijlstra <peterz@infradead.org>
First post2017-03-20 11:50 +0100
Last post2017-03-21 00:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] sched: Wake up all non-exclusive waiters in  __wake_up_common() Peter Zijlstra <peterz@infradead.org> - 2017-03-20 11:50 +0100
    Re: [PATCH] sched: Wake up all non-exclusive waiters in  __wake_up_common() Byungchul Park <byungchul.park@lge.com> - 2017-03-21 00:20 +0100

#1604359 — Re: [PATCH] sched: Wake up all non-exclusive waiters in __wake_up_common()

FromPeter Zijlstra <peterz@infradead.org>
Date2017-03-20 11:50 +0100
SubjectRe: [PATCH] sched: Wake up all non-exclusive waiters in __wake_up_common()
Message-ID<tn32W-3u2-15@gated-at.bofh.it>
On Wed, Mar 08, 2017 at 09:21:52AM +0900, Byungchul Park wrote:
> __wake_up_common() should wake up all non-exclusive waiters and
> exclusive waiters as many as nr_exclusive, but currently it does not.
> 
> Consider a wait queue like the following for example:
> 
>    A(exclusive) -> B(non-exclusive) -> C(non-exclusive)
> 
> Current code will wake up only A when nr_exclusive = 1, but has to wake
> up A, B and C. Make it do as we expect.

You have the list oredered the wrong way around. We add exclusive
waiters to the tail, therefore we'll have woken up all the !exclusive
waiters before we start decrementing nr_exclusive.

[toc] | [next] | [standalone]


#1605196

FromByungchul Park <byungchul.park@lge.com>
Date2017-03-21 00:20 +0100
Message-ID<tneKJ-3jB-1@gated-at.bofh.it>
In reply to#1604359
On Mon, Mar 20, 2017 at 11:41:47AM +0100, Peter Zijlstra wrote:
> On Wed, Mar 08, 2017 at 09:21:52AM +0900, Byungchul Park wrote:
> > __wake_up_common() should wake up all non-exclusive waiters and
> > exclusive waiters as many as nr_exclusive, but currently it does not.
> > 
> > Consider a wait queue like the following for example:
> > 
> >    A(exclusive) -> B(non-exclusive) -> C(non-exclusive)
> > 
> > Current code will wake up only A when nr_exclusive = 1, but has to wake
> > up A, B and C. Make it do as we expect.
> 
> You have the list oredered the wrong way around. We add exclusive
> waiters to the tail, therefore we'll have woken up all the !exclusive
> waiters before we start decrementing nr_exclusive.

You're right. I proposed the patch because of __add_wait_queue_exclusive(),
which queues an item at the head. But it was my mistake. Sorry.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web