[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160313042723.GC29218@thunk.org>
Date: Sat, 12 Mar 2016 23:27:23 -0500
From: Theodore Ts'o <tytso@....edu>
To: Jan Kara <jack@...e.cz>
Cc: "HUANG Weller (CM/ESW12-CN)" <Weller.Huang@...bosch.com>,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
"Li, Michael" <huayil@....qualcomm.com>
Subject: Re: ext4 out of order when use cfq scheduler
On Thu, Jan 07, 2016 at 12:47:36PM +0100, Jan Kara wrote:
>
> The problem is in all kernels starting with 3.8. Attached is a patch which
> should fix the issue. Can you test whether it fixes the problem for you?
Sorry, I missed this patch because it was attached to an discussion
thread.
> The problem is that although for delayed allocated blocks we write their
> contents immediately after allocating them, there is no guarantee that
> the IO scheduler or device doesn't reorder things
I don't think that's the problem. In the commit thread when we call
blkdev_issue_flush() that acts as a barrier so the I/O scheduler won't
reorder writes after that point, which is before we write the commit
block. Instead, I believe the problem is in ext4_writepages:
ext4_journal_stop(handle);
/* Submit prepared bio */
ext4_io_submit(&mpd.io_submit);
Once we release the handle, the commit can start --- *before* we have
a chance to submit the I/O. Oops.
I believe if we swap these two calls, it should fix the problem Huang
was seeing.
Jan, do you agree?
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists