Re: [RFC PATCH 01/13] futex2: Implement wait and wake functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



André Almeida <andrealmeid@xxxxxxxxxxxxx> 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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux