public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Waiman Long <Waiman.Long@hp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Scott J Norton <scott.norton@hp.com>,
	Douglas Hatch <doug.hatch@hp.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] x86/mm/fault: Put pgd_lock in its own cacheline
Date: Thu, 11 Jun 2015 15:41:24 +0200	[thread overview]
Message-ID: <20150611134124.GA23728@gmail.com> (raw)
In-Reply-To: <1433941708-40686-1-git-send-email-Waiman.Long@hp.com>


* Waiman Long <Waiman.Long@hp.com> wrote:

> On a large system with many cores, massive creation or destruction
> of processes/threads can sometime cause a fair amount of spinlock
> contention in the pgd_lock used by the pgd_alloc() and pgd_free()
> functions. This patch tries to reduce false cacheline sharing by
> putting the pgd_lock in its own cacheline which help to reduce
> contention on the lock.
> 
> Signed-off-by: Waiman Long <Waiman.Long@hp.com>
> ---
>  arch/x86/mm/fault.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 181c53b..fae48df 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -185,7 +185,7 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
>  	force_sig_info(si_signo, &info, tsk);
>  }
>  
> -DEFINE_SPINLOCK(pgd_lock);
> +__cacheline_aligned_in_smp DEFINE_SPINLOCK(pgd_lock);
>  LIST_HEAD(pgd_list);

Yeah, so if you are seeing pgd_lock contention we could do a lot more to improve 
the performance of pgd allocation than just putting it on a separate cacheline: we 
can actually eliminate pgd_list and turn all pgd_list users into RCU walkers of 
the tasklist lock, and make pgd_alloc()/pgd_free() lockless on x86.

I've done a series that implements this, I'll post it soon, please stay tuned!

Thanks,

	Ingo

      reply	other threads:[~2015-06-11 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 13:08 [PATCH] x86/mm/fault: Put pgd_lock in its own cacheline Waiman Long
2015-06-11 13:41 ` Ingo Molnar [this message]

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=20150611134124.GA23728@gmail.com \
    --to=mingo@kernel.org \
    --cc=Waiman.Long@hp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=doug.hatch@hp.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=scott.norton@hp.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox