From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: [PATCH 02/16] quota: Make global quota locks cacheline aligned Date: Tue, 27 Jan 2009 17:48:35 +0100 Message-ID: <1233074929-12277-3-git-send-email-jack@suse.cz> References: <1233074929-12277-1-git-send-email-jack@suse.cz> <1233074929-12277-2-git-send-email-jack@suse.cz> Cc: Jan Kara , Andrew Morton To: linux-fsdevel@vger.kernel.org Return-path: Received: from styx.suse.cz ([82.119.242.94]:42445 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754272AbZA0Qsv (ORCPT ); Tue, 27 Jan 2009 11:48:51 -0500 In-Reply-To: <1233074929-12277-2-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Andrew Morton has suggested that three global quota locks can end up in the same cacheline which can result in bad cacheline ping-pong on SMP machines. Make locks cacheline aligned so that we avoid this problem (thanks goes to Andrew for the idea). Signed-off-by: Jan Kara CC: Andrew Morton --- fs/quota/dquot.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 28aa146..e840fa2 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -129,9 +129,9 @@ * i_mutex on quota files is special (it's below dqio_mutex) */ -static DEFINE_SPINLOCK(dq_list_lock); -static DEFINE_SPINLOCK(dq_state_lock); -DEFINE_SPINLOCK(dq_data_lock); +static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_list_lock); +static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_state_lock); +__cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_data_lock); EXPORT_SYMBOL(dq_data_lock); static char *quotatypes[] = INITQFNAMES; -- 1.6.0.2