[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <573F77EF.3020409@hpe.com>
Date: Fri, 20 May 2016 16:47:43 -0400
From: Waiman Long <waiman.long@....com>
To: Davidlohr Bueso <dave@...olabs.net>
CC: Peter Zijlstra <peterz@...radead.org>, <manfred@...orfullife.com>,
<mingo@...nel.org>, <torvalds@...ux-foundation.org>,
<ggherdovich@...e.com>, <mgorman@...hsingularity.net>,
<linux-kernel@...r.kernel.org>
Subject: Re: sem_lock() vs qspinlocks
On 05/20/2016 11:00 AM, Davidlohr Bueso wrote:
> On Fri, 20 May 2016, Peter Zijlstra wrote:
>
>> On Thu, May 19, 2016 at 10:39:26PM -0700, Davidlohr Bueso wrote:
>>> In addition, this makes me wonder if queued_spin_is_locked() should
>>> then be:
>>>
>>> - return atomic_read(&lock->val);
>>> + return atomic_read(&lock->val) & _Q_LOCKED_MASK;
>>>
>>> And avoid considering pending waiters as locked.
>>
>> Probably
>
> Similarly, and I know you hate it, but afaict, then semantically
> queued_spin_is_contended() ought to be:
>
> - return atomic_read(&lock->val) & ~_Q_LOCKED_MASK;
> + return atomic_read(&lock->val);
>
> Thanks,
> Davidlohr
Looking for contended lock, you need to consider the lock waiters also.
So looking at the whole word is right.
Cheers,
Longman
Powered by blists - more mailing lists