André Almeida <andrealm...@collabora.com> writes:

>>> +           if (unlikely(ret)) {
>>> +                   spin_unlock(&bucket->lock);
>>> +
>>> +                   bucket_dec_waiters(bucket);
>>> +                   __set_current_state(TASK_RUNNING);
>>> +                   *awakened = futex_dequeue_multiple(futexv, i);
>>> +
>>> +                   if (__get_user(uval, uaddr))
>>> +                           return -EFAULT;
>>> +
>>> +                   if (*awakened >= 0)
>>> +                           return 1;
>> If you are awakened, you don't need to waste time with trying to get
>> the
>> next key.
>> 
>
> Yes, and this is what this return is supposed to do. What I'm missing?

you don't need to do that __get_user if some other key was already awoke.

[...]
if (*awakened >= 0)
        return 1;

if (__get_user(uval, uaddr))
        return -EFAULT;
[...]

-- 
Gabriel Krisman Bertazi

Reply via email to