From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH 2/3] dio: scale unaligned IO tracking via multiple lists Date: Mon, 08 Nov 2010 10:36:06 -0500 Message-ID: References: <1289202023-15102-1-git-send-email-david@fromorbit.com> <1289202023-15102-3-git-send-email-david@fromorbit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Dave Chinner Return-path: In-Reply-To: <1289202023-15102-3-git-send-email-david@fromorbit.com> (Dave Chinner's message of "Mon, 8 Nov 2010 18:40:22 +1100") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Dave Chinner writes: > From: Dave Chinner > > To avoid concerns that a single list and lock tracking the unaligned > IOs will not scale appropriately, create multiple lists and locks > and chose them by hashing the unaligned block being zeroed. > > Signed-off-by: Dave Chinner > --- > fs/direct-io.c | 49 ++++++++++++++++++++++++++++++++++++------------- > 1 files changed, 36 insertions(+), 13 deletions(-) > > diff --git a/fs/direct-io.c b/fs/direct-io.c > index 1a69efd..353ac52 100644 > --- a/fs/direct-io.c > +++ b/fs/direct-io.c > @@ -152,8 +152,28 @@ struct dio_zero_block { > atomic_t ref; /* reference count */ > }; > > -static DEFINE_SPINLOCK(dio_zero_block_lock); > -static LIST_HEAD(dio_zero_block_list); > +#define DIO_ZERO_BLOCK_NR 37LL I'm always curious to know how these numbers are derived. Why 37? Cheers, Jeff