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:	Mon, 2 Feb 2015 18:29:53 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC PATCH 4/4] sched: Account PREEMPT_ACTIVE context as atomic

On Wed, Jan 28, 2015 at 04:46:37PM +0100, Peter Zijlstra wrote:
> On Wed, Jan 28, 2015 at 01:24:12AM +0100, Frederic Weisbecker wrote:
> > PREEMPT_ACTIVE implies non-preemptible context and thus atomic context
> > despite what in_atomic*() APIs reports about it. These functions
> > shouldn't ignore this value like they are currently doing.
> > 
> > It appears that these APIs were ignoring PREEMPT_ACTIVE in order to
> > ease the check in schedule_debug(). Meanwhile it is sufficient to rely
> > on PREEMPT_ACTIVE in order to disable preemption in __schedule().
> > 
> > So lets fix the in_atomic*() APIs and simplify the preempt count ops
> > on __schedule() callers.
> 
> So what I think the history is here is that PREEMPT_ACTIVE is/was seen
> as a flag, protecting recursion, not so much a preempt-disable.
> 
> By doing this, you loose that separation.

Indeed, preemption disablement is a side effet.

> 
> Note that (at least on x86) we have another flag in the preempt count.
> 
> And I don't think the generated code really changes, the only difference
> is the value added/subtracted and that's an encoded immediate I think.

Right the resulting code isn't optimized at all with this patch. Only the C code
was deemed to be more simple but actually it isn't since we are abusing a side
effect property.

I'm dropping this patch then.

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