From: Shaohua Li <shaohua.li@intel.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"jaxboe@fusionio.com" <jaxboe@fusionio.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
"khlebnikov@openvz.org" <khlebnikov@openvz.org>,
"jmoyer@redhat.com" <jmoyer@redhat.com>
Subject: Re: [RFC PATCH 0/3] block: Fix fsync slowness with CFQ cgroups
Date: Tue, 28 Jun 2011 09:18:52 +0800 [thread overview]
Message-ID: <1309223932.15392.186.camel@sli10-conroe> (raw)
In-Reply-To: <1309205864-13124-1-git-send-email-vgoyal@redhat.com>
On Tue, 2011-06-28 at 04:17 +0800, Vivek Goyal wrote:
> Hi,
>
> Konstantin reported that fsync is very slow with ext4 if fsyncing process
> is in a separate cgroup and one is using CFQ IO scheduler.
>
> https://lkml.org/lkml/2011/6/23/269
>
> Issue seems to be that fsync process is in a separate cgroup and journalling
> thread is in root cgroup. After every IO from fsync, CFQ idles on fysnc
> process queue waiting for more requests to come. But this process is now
> waiting for IO to finish from journaling thread. After waiting for 8ms
> fsync's queue gives way to jbd's queue. Then we start idling on jbd
> thread and new IO from fsync is sitting in a separate queue in a separate
> group.
>
> Bottom line, that after every IO we end up idling on fysnc and jbd thread
> so much that if somebody is doing fsync after every 4K of IO, throughput
> nose dives.
>
> Similar issue had issue come up with-in same cgroup also when "fsync"
> and "jbd" thread were being queued on differnt service trees and idling
> was killing. At that point of time two solutions were proposed. One
> from Jeff Moyer and one from Corrado Zoccolo.
>
> Jeff came up with the idea of coming with block layer API to yield the
> queue if explicitly told by file system, hence cutting down on idling.
>
> https://lkml.org/lkml/2010/7/2/277
>
> Corrado, came up with a simpler approach of keeping jbd and fsync processes
> on same service tree by parsing RQ_NOIDLE flag. By queuing on same service
> tree, one queue preempts other queue hence cutting down on idling time.
> Upstream went ahead with simpler approach to fix the issue.
>
> commit 749ef9f8423054e326f3a246327ed2db4b6d395f
> Author: Corrado Zoccolo <czoccolo@gmail.com>
> Date: Mon Sep 20 15:24:50 2010 +0200
>
> cfq: improve fsync performance for small files
>
>
> Now with cgroups, same problem resurfaces but this time we can not queue
> both the processes on same service tree and take advantage of preemption
> as separate cgroups have separate service trees and both processes
> belong to separate cgroups. We do not allow cross cgroup preemption
> as that wil break down the isolation between groups.
>
> So this patch series resurrects Jeff's solution of file system specifying
> the IO dependencies between threads explicitly to the block layer/ioscheduler.
> One ioscheduler knows that current queue we are idling on is dependent on
> IO from some other queue, CFQ allows dispatch of requests from that other
> queue in the context of current active queue.
>
> So if fysnc thread specifies the dependency on journalling thread, then
> when time slice of fsync thread is running, it allows dispatch from
> jbd in the time slice of fsync thread. Hence cutting down on idling.
>
> This patch series seems to be working for me. I did testing for ext4 only.
> This series is based on for-3.1/core branch of Jen's block tree.
> Konstantin, can you please give it a try and see if it fixes your
> issue.
>
> Any feedback on how to solve this issue is appreciated.
Hi Vivek,
can we introduce a group think time check in cfq? say in a group the
last queue is backed for the group and the queue is a non-idle queue, if
the group think time is big, we don't allow the group idle and preempt
could happen. The fsync thread is a non-idle queue with Corrado's patch,
this allows fast group switch.
Thanks,
Shaohua
next prev parent reply other threads:[~2011-06-28 1:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 20:17 [RFC PATCH 0/3] block: Fix fsync slowness with CFQ cgroups Vivek Goyal
2011-06-27 20:17 ` [PATCH 1/3] block: A new interface for specifying IO dependencing among tasks Vivek Goyal
2011-06-27 20:17 ` [PATCH 2/3] ext4: Explicitly specify fsync dependency on journaling thread Vivek Goyal
2011-06-27 20:17 ` [PATCH 3/3] ext3: " Vivek Goyal
2011-06-28 1:18 ` Shaohua Li [this message]
2011-06-28 1:40 ` [RFC PATCH 0/3] block: Fix fsync slowness with CFQ cgroups Vivek Goyal
2011-06-28 2:03 ` Shaohua Li
2011-06-28 13:04 ` Vivek Goyal
2011-06-29 1:04 ` Shaohua Li
2011-06-29 1:29 ` Vivek Goyal
2011-06-30 0:29 ` Shaohua Li
2011-06-28 2:47 ` Dave Chinner
2011-06-28 13:35 ` Vivek Goyal
2011-06-28 11:00 ` Konstantin Khlebnikov
2011-06-28 13:45 ` Vivek Goyal
2011-06-28 14:42 ` Konstantin Khlebnikov
2011-06-28 14:47 ` Vivek Goyal
2011-06-28 21:20 ` Vivek Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309223932.15392.186.camel@sli10-conroe \
--to=shaohua.li@intel.com \
--cc=jaxboe@fusionio.com \
--cc=jmoyer@redhat.com \
--cc=khlebnikov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox