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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Jun 2013 04:07:33 +0400
From:	Kirill Tkhai <tkhai@...dex.ru>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	Peter Zijlstra <peterz@...radead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>, tglx@...utronix.de
Subject: Re: [PATCH] spin_unlock*_no_resched()

On 12/06/13 17:07, Steven Rostedt wrote:
> On Wed, 2013-06-12 at 14:15 +0200, Peter Zijlstra wrote:
>
>> So I absolutely hate this API because people can (and invariably will)
>> abuse it; much like they did/do preempt_enable_no_resched().
>
> Me too.
>
>>
>> IIRC Thomas even maps preempt_enable_no_resched() to preempt_enable() in
>> -rt to make sure we don't miss preemption points due to stupidity.
>>
>> He converted the 'few' sane sites to use schedule_preempt_disabled(). In
>> that vein, does it make sense to introduce schedule_spin_locked()?
>>
>
> I was thinking the exact same thing when I read this patch. This is a
> strict policy that we should enforce and not let individual developers
> implement. Yes, a schedule_spin_unlock() would work nicely. The API will
> enforce the two to be used together. Otherwise, I can envision seeing
> things like:
>
> 	preempt_disable();
> 	[...]
>
> 	spin_lock(x);
>
> 	spin_unlock_no_resched(x);
>
> 	[...]
>
> 	preempt_enable();
>
> And developers having no idea why the above is broken. Although, I would
> say the above is broken for other reasons, but I was just using that to
> show the craziness such an API would give to us.
>
> -- Steve
>
>
>

In additional to my previous letter. If spin_lock is locked then irqs
must be disabled. So sorry for the noise.

--
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