From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964891AbbFJNIu (ORCPT ); Wed, 10 Jun 2015 09:08:50 -0400 Received: from g4t3425.houston.hp.com ([15.201.208.53]:39877 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964855AbbFJNIo (ORCPT ); Wed, 10 Jun 2015 09:08:44 -0400 From: Waiman Long To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Cc: linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch , Waiman Long Subject: [PATCH] x86/mm/fault: Put pgd_lock in its own cacheline Date: Wed, 10 Jun 2015 09:08:28 -0400 Message-Id: <1433941708-40686-1-git-send-email-Waiman.Long@hp.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); #ifdef CONFIG_X86_32 -- 1.7.1