lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 11 Aug 2014 15:35:24 -0400
From:	Waiman Long <waiman.long@...com>
To:	Davidlohr Bueso <davidlohr@...com>
CC:	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org, Jason Low <jason.low2@...com>,
	Scott J Norton <scott.norton@...com>, aswin@...com
Subject: Re: [PATCH v2 1/7] locking/rwsem: check for active writer/spinner
 before wakeup

On 08/10/2014 07:50 PM, Davidlohr Bueso wrote:
> On Sun, 2014-08-10 at 17:41 -0400, Waiman Long wrote:
>> On 08/08/2014 03:03 PM, Davidlohr Bueso wrote:
>>> On Fri, 2014-08-08 at 14:30 -0400, Waiman Long wrote:
>>>> I have 2 issues about this. First of all, the timing windows between
>>>> atomic_set() and mutex_has_owner() check is really small, I doubt it
>>>> will be that effective.
>>> That is true, which is why I didn't bother showing any performance data
>>> in the changelog. However, more important than any performance, avoiding
>>> bogus wakeups is the _right_ thing to do when allowing lock stealing.
>>>
>>>> Secondly, I think you may need to call
>>>> mutex_release() and debug_mutex_unlock() to make the debugging code
>>>> work, but they seems to be called only under the wait_lock. So I think
>>>> there is more work that need to be done before this patch is ready.
>>> When !DEBUG both mutex_release() and debug_mutex_unlock() should be
>>> no-ops. So this allows us to do the mutex_has_owner() check *without*
>>> holding the wait_lock.
>>>
>>> When DEBUG is set, we don't even bother calling mutex_has_owner(), so
>>> nothing changes.
>>>
>>> I don't understand your concern.
>> It is true I forgot the fact that MUTEX_SPIN_ON_OWNER is disabled when
>> DEBUG_MUTEX is on. However, mutex_release is controlled by the LOCKDEP
>> config variable which is independent of DEBUG_MUTEX. So it is still a
>> concern.
> But afaict you cannot have LOCKDEP without enabling DEBUG_MUTEX (but not
> necessarily vice-versa). Both are quite intertwined within other
> debugging dependencies/options.
>

I think you are right. This will require comment in the code to avoid 
this kind of confusion.

-Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ