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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150611134124.GA23728@gmail.com>
Date:	Thu, 11 Jun 2015 15:41:24 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Waiman Long <Waiman.Long@...com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Scott J Norton <scott.norton@...com>,
	Douglas Hatch <doug.hatch@...com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] x86/mm/fault: Put pgd_lock in its own cacheline


* Waiman Long <Waiman.Long@...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@...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
--
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