lkml.org 
[lkml]   [2015]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] futex: Robustify wake_futex()

* Davidlohr Bueso <dave@stgolabs.net> wrote:

> @@ -1674,13 +1689,19 @@ retry_private:
> }
>
> /*
> - * Wake nr_wake waiters. For requeue_pi, if we acquired the
> - * lock, we already woke the top_waiter. If not, it will be
> - * woken by futex_unlock_pi().
> + * For requeue_pi, if we acquired the lock, we already woke
> + * the top_waiter. If not, it will be woken by futex_unlock_pi.
> + *
> + * The regular (non-pi) case is much simpler: Wake the top
> + * waiter (next in line) and repeat.
> */
> - if (++task_count <= nr_wake && !requeue_pi) {
> - wake_futex(this);
> - continue;
> + if (!requeue_pi) {
> + if (!wake_futex(this)) {
> + ret = -EINVAL;
> + break;
> + }
> + if (++task_count <= nr_wake)
> + continue;
> }
>

Hm, so at a first glance this change appears to go beyond
the scope of adding a return value to wake_futex()?

For example before the change in the !requeue_pi case we'd
only call wake_futex() if ++task_count <= nr_wake, after
the change we always call it.

What's the intention here?

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-02-19 11:21    [W:1.087 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site