From: Tao Ma <tm@tao.ma>
To: Jan Kara <jack@suse.cz>
Cc: Jeff Moyer <jmoyer@redhat.com>, Vivek Goyal <vgoyal@redhat.com>,
linux-ext4@vger.kernel.org, stable@kernel.org,
Corrado Zoccolo <czoccolo@gmail.com>,
Jens Axboe <jaxboe@fusionio.com>
Subject: Re: [PATCH] jbd/2[stable only]: Use WRITE_SYNC_PLUG in journal_commit_transaction.
Date: Fri, 15 Jul 2011 10:43:47 +0800 [thread overview]
Message-ID: <4E1FA963.8010403@tao.ma> (raw)
In-Reply-To: <20110714213822.GC16415@quack.suse.cz>
Hi Vivek and Jeff,
On 07/15/2011 05:38 AM, Jan Kara wrote:
> On Thu 14-07-11 16:08:24, Jeff Moyer wrote:
>> Jan Kara <jack@suse.cz> writes:
>>
>>> On Thu 14-07-11 12:30:32, Jeff Moyer wrote:
>>>> Tao Ma <tm@tao.ma> writes:
>>>>>> - WRITE_SYNC_PLUG will plug the queue and expects explicity unplug. Who
>>>>>> is doing unplug in this case?
>>>>> See the comments I removed, "we rely on sync_buffer() doing the unplug
>>>>> for us". I removed them cause we all use pluged write now.
>>>>
>>>> Your logic is upside-down. The code currently only uses the _PLUG
>>>> variant when t_synchronous_commit is set, meaning somebody *will* call
>>>> sync_buffer. Simply setting WRITE_SYNC_PLUG doens't mean the upper
>>>> layer is going to issue the unplug. Of course, I'm not 100% sure of the
>>>> journaling process, so it may very well be that there always is an
>>>> unplug. Can Jan or someone comment on that? Anyway, you could test
>>>> this theory by seeing if your kernel generates any timer unplugs in the
>>>> blktrace output.
>>> So I'm not expert in plugging code but from what I understand when we do
>>> wait_on_buffer() (which calls io_schedule()) which will do
>>> blk_flush_plug()), the queue will get unplugged and IO starts. And we wait
>>> for all buffers we submit so we are guaranteed wait_on_buffer() will be
>>> called...
>>
>> Sorry, I should have been more specific. As Vivek mentioned, we're
>> talking about older kernels (pre the blk plugging series). So, the
>> question is, if journal_commit_transaction is called with
>> t_synchronous_commit not set, will the underlying device ever be
>> unplugged by the journal code? My guess is there's no explicit unplug,
>> so it's not correct to replace a WRITE_SYNC with a WRITE_SYNC_PLUG.
> There are no explicit unplugs in journalling code. But checking the code
> in 2.6.37, I still see wait_on_buffer() calls sync_bh() which calls
> blk_run_address_space() which ends up calling bdi->unplug_io_fn() so I
> would say unplug is called anyway.
yeah, jbd2 works like what Jan described.
And what's more, if you looked at the commit I mentioned(749ef9f8423),
this commit just changed WRITE to WRITE_SYNC, so in the old times(before
that commit is merged), WRITE has been used in jbd/2 for many years. It
also doesn't do a explicit unplug, let the scheduler do the merge and
reply on sync_bh to unplug the device. So change WRITE to
WRITE_SYNC_PLUG is welcomed, but change WRITE to WRITE_SYNC is broken
since it splits the sequential write to several i/o requests.
Thanks
Tao
next prev parent reply other threads:[~2011-07-15 2:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 10:43 [PATCH] jbd/2[stable only]: Use WRITE_SYNC_PLUG in journal_commit_transaction Tao Ma
2011-07-12 12:30 ` Vivek Goyal
2011-07-12 15:19 ` Tao Ma
2011-07-14 16:30 ` Jeff Moyer
2011-07-14 19:46 ` Jan Kara
2011-07-14 20:01 ` Vivek Goyal
2011-07-14 20:08 ` Jeff Moyer
2011-07-14 21:38 ` Jan Kara
2011-07-15 2:43 ` Tao Ma [this message]
2011-07-12 15:55 ` [stable] " Greg KH
2011-07-13 2:10 ` Tao Ma
2011-07-13 2:17 ` Greg KH
2011-07-13 2:21 ` Tao Ma
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=4E1FA963.8010403@tao.ma \
--to=tm@tao.ma \
--cc=czoccolo@gmail.com \
--cc=jack@suse.cz \
--cc=jaxboe@fusionio.com \
--cc=jmoyer@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.