[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C8CBC50.1070400@kernel.org>
Date: Sun, 12 Sep 2010 13:41:04 +0200
From: Tejun Heo <tj@...nel.org>
To: Tao Ma <tao.ma@...cle.com>
CC: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 02/41] block/loop: queue ordered mode should be DRAIN_FLUSH
Hello,
On 09/12/2010 10:38 AM, Tao Ma wrote:
> According to Documentation/block/barrier.txt,
> QUEUE_ORDERED_DRAIN
> Requests are ordered by draining the request queue and cache
> flushing isn't needed.
>
> Sequence: drain => barrier
>
> QUEUE_ORDERED_DRAIN_FLUSH
> Requests are ordered by draining the request queue and both
> pre-barrier and post-barrier cache flushings are needed.
>
> Sequence: drain => preflush => barrier => postflush
>
> And for loop device, it call fsync in barrier request. See do_bio_filebacked in drivers/block/loop.c
> bool barrier = !!(bio->bi_rw & REQ_HARDBARRIER);
> struct file *file = lo->lo_backing_file;
>
> if (barrier) {
> if (unlikely(!file->f_op->fsync)) {
> ret = -EOPNOTSUPP;
> goto out;
> }
>
> ret = vfs_fsync(file, 0);
> if (unlikely(ret)) {
> ret = -EIO;
> goto out;
> }
> }
>
> So actually the sync is done in barrier and no extra flush is needed?
> Or Do I misread the rules in barrier.txt?
Hmmm... maybe the doc was a bit confusing. Any device which has
writeback cache should have FLUSH in the queue ordered configuration.
The loop device used vfs_fsync() for cache flushing and didn't support
ordered sequence. As such, it should use draining for request
ordering and suports FLUSH, so the mode to use is DRAIN_FLUSH.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists