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:	Wed, 6 Jun 2012 19:41:04 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	hpa@...or.com, linux-kernel@...r.kernel.org,
	torvalds@...ux-foundation.org, shai@...lemp.com,
	akpm@...ux-foundation.org, tglx@...utronix.de, ido@...ery.com,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/mm] x86/pat: Avoid contention on cpa_lock if possible


* Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:

> On Wed, 2012-06-06 at 09:18 -0700, tip-bot for Shai Fultheim wrote:
> 
> > [ I absolutely hate these locking patterns ... yet I have no better idea. Maybe the gents on Cc: ... ]
> > Signed-off-by: Ingo Molnar <mingo@...nel.org>
> 
> Oh yuck, this is vile..
> 
> static struct static_key scale_mp_trainwreck = STATIC_KEY_INIT_FALSE;
> 
> static DEFINE_SPINLOCK(_cpa_lock);
> 
> static inline void cpa_lock(void)
> {
> 	if (static_key_false(&scale_mp_trainwreck))
> 		return;
> 
> 	spin_lock(&_cpa_lock);
> }
> 
> static inline void cpa_unlock(void)
> {
> 	if (static_key_false(&scale_mp_trainwreck))
> 		return;
> 
> 	spin_lock(&_cpa_lock);
> }
> 
> And then use cpa_{,un}lock(), and the scale-mp guys can
> static_key_slow_inc(&scale_mp_trainwreck).
> 
> [ and yes I hate those jump_label names ... but I'm not wanting
>   to go through another round of bike-shed painting. ]

ok.

Another problem this patch has is inadequate testing:

arch/x86/mm/pageattr.c:798:2: error: implicit declaration of 
function ‘is_vsmp_box’ [-Werror=implicit-function-declaration]

So I'm removing it from tip:x86/mm for now.

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