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-next>] [day] [month] [year] [list]
Date:	Tue, 6 Mar 2012 08:46:01 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	akpm@...ux-foundation.org
Cc:	tglx@...utronix.de, hpa@...or.com, alex.shi@...el.com,
	cl@...two.org, sfr@...b.auug.org.au, tj@...nel.org,
	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [patch 5/8] x86: use this_cpu_xxx to replace percpu_xxx funcs


* akpm@...ux-foundation.org <akpm@...ux-foundation.org> wrote:

> From: Alex Shi <alex.shi@...el.com>
> Subject: x86: use this_cpu_xxx to replace percpu_xxx funcs
> 
> Since percpu_xxx() serial functions are duplicate with this_cpu_xxx(). 
> Removing percpu_xxx() definition and replacing them by this_cpu_xxx() in
> code.
> 
> And further more, as Christoph Lameter's requirement, I try to use
> __this_cpu_xx to replace this_cpu_xxx if it is in preempt safe scenario.
> The preempt safe scenarios include:
> 1, in irq/softirq/nmi handler
> 2, protected by preempt_disable
> 3, protected by spin_lock
> 4, if the code context imply that it is preempt safe, like the code is
> follows or be followed a preempt safe code.
> 
> BTW, In fact, this_cpu_xxx are same as __this_cpu_xxx since all funcs
> implement in a single instruction for x86 machine.  But it maybe other
> platforms' performance.

but this is an x86 only patch.

> -	percpu_write(irq_regs, new_regs);
> +	__this_cpu_write(irq_regs, new_regs);

So what's the point of all this ugly churn?

Will percpu_write() be removed altogether? If so then the 
changelog should say *that*, and explain that on x86 this is a 
simple renaming of the API, not a long explanation about 
scenarios that don't actually matter.

If percpu_write() is not being removed then I don't see how this 
patch is an improvement: it's supposed to result in the same 
instructions being emitted, and __this_cpu_write() et al are 
distinctly longer to write ...

So what's the plan here?

Thanks,

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