All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Yariv <ido@wizery.com>
To: "Shai Fultheim (Shai@ScaleMP.com)" <Shai@ScaleMP.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:x86/mm] x86/pat: Avoid contention on cpa_lock if possible
Date: Thu, 7 Jun 2012 02:05:44 +0300	[thread overview]
Message-ID: <20120606230544.GA25288@WorkStation.localnet> (raw)
In-Reply-To: <9B14D1490DDECA4E974F6B9FC9EBAB317EEFC74FD0@VMBX108.ihostexchange.net>

Hi,

On Wed, Jun 06, 2012 at 06:18:12PM -0400, Shai Fultheim (Shai@ScaleMP.com) wrote:
> Peter Zijlstra [mailto:a.p.zijlstra@chello.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@kernel.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. ]
> 
> Looks pretty straight forward to do.  
> We will try this route, as I'm concerned that synthetic CPUID bit will be kind of a global change for a pretty local consideration.
> 
> Comments?

The synthetic CPUID bit approach has the advantage of setting this bit
from the platform initialization code independently (in this case, in
vsmp_64.c) instead of calling platform specific functions from
pageattr.c (such as is_vsmp_box()) or exporting the static_key variable.

We'll give this a shot and send a revised patch after testing it.

Sounds good?

Thanks,
Ido.

  reply	other threads:[~2012-06-06 23:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 12:40 [PATCH] x86: Avoid contention on cpa_lock if possible Ido Yariv
2012-04-19 22:11 ` [PATCH RESEND] " Ido Yariv
2012-05-05 23:49   ` Ido Yariv
2012-06-02 18:56   ` Ido Yariv
2012-06-06 16:18   ` [tip:x86/mm] x86/pat: " tip-bot for Shai Fultheim
2012-06-06 17:24     ` Peter Zijlstra
2012-06-06 17:41       ` Ingo Molnar
2012-06-06 18:58       ` H. Peter Anvin
2012-06-06 22:18       ` Shai Fultheim (Shai@ScaleMP.com)
2012-06-06 23:05         ` Ido Yariv [this message]
2012-06-06 23:07           ` Shai Fultheim (Shai@ScaleMP.com)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120606230544.GA25288@WorkStation.localnet \
    --to=ido@wizery.com \
    --cc=Shai@ScaleMP.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.