xfs
[Top] [All Lists]

Re: working on extent locks for i_mutex

To: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Subject: Re: working on extent locks for i_mutex
From: Frank Mayhar <fmayhar@xxxxxxxxxx>
Date: Thu, 19 Jan 2012 13:16:10 -0800
Cc: Allison Henderson <achender@xxxxxxxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Lukas Czerner <lczerner@xxxxxxxxxx>, Ext4 Developers List <linux-ext4@xxxxxxxxxxxxxxx>, Tao Ma <tm@xxxxxx>, xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:organization :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=2X+eO4yG+d/b/X0BNlh7cA8LnGW0utmcIr0wrbtGMK8=; b=IBwpqEViSKuHJ2r7wwtqPHdyXZ9diuoF3nmVC4qyWhz4DSqLhVV8vOVbQbZ+Z9lBMS p2LbCO15e2jV/I0l6XQCuhki6ocDtByrxF200O2R8KyvDbp9N8rHKdPJafdG6GObcxqG gC8TE3Q/9p4CSvEWBL5yCiVtlZEhI1DzebKcg=
In-reply-to: <20120118120223.GA4322@xxxxxxxxx>
Organization: Google Inc.
References: <4F0F9E97.1090403@xxxxxxxxxxxxxxxxxx> <20120113043411.GH2806@dastard> <4F10992C.3070303@xxxxxxxxxxxxxxxxxx> <20120115235747.GA6922@dastard> <4F146275.8090304@xxxxxxxxxxxxxxxxxx> <20120118120223.GA4322@xxxxxxxxx>
On Wed, 2012-01-18 at 20:02 +0800, Zheng Liu wrote:
> For this project, do you have a schedule? Would you like to share to me? This
> lock contention heavily impacts the performance of direct IO in our production
> environment. So we hope to improve it ASAP.
> 
> I have done some direct IO benchmarks to compare ext4 with xfs using fio
> in Intel SSD. The result shows that, in direct IO, xfs outperforms ext4 and
> ext4 with dioread_nolock.
> 
> To understand the effect of lock contention, I define a new function called 
> ext4_file_aio_write() that calls __generic_file_aio_write() without acquiring 
> i_mutex lock. Meanwhile, I remove DIO_LOCKING flag when 
> __blockdev_direct_IO() 
> is called and do the similar benchmarks. The result shows that the 
> performance 
> in ext4 is almost the same to the xfs. Thus, it proves that the i_mutex 
> heavily
> impacts the performance. Hopefully the result is useful for you. :-)

For the record, I have a patchset that, while not affecting i_mutex (or
locking in general), does allow AIO append writes to actually be done
asynchronously.  (Currently they're forced to be done synchronously.)
It makes a big difference in performance for that particular case, even
for spinning media.  Performance roughly doubled when testing with fio
against a regular two-terabyte drive; the performance improvement
against SSD would have to be much greater.

One day soon I'll accumulate enough spare time to port the patchset
forward to the latest kernel and submit it here.
-- 
Frank Mayhar
fmayhar@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>