[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fafa0550-184c-e59c-9b79-bd5d716a20cc@huawei.com>
Date: Sun, 19 Jan 2020 14:55:14 +0800
From: "yukuai (C)" <yukuai3@...wei.com>
To: Matthew Wilcox <willy@...radead.org>
CC: <hch@...radead.org>, <darrick.wong@...cle.com>,
<linux-xfs@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <houtao1@...wei.com>,
<zhengbin13@...wei.com>, <yi.zhang@...wei.com>
Subject: Re: [RFC] iomap: fix race between readahead and direct write
On 2020/1/19 14:14, Matthew Wilcox wrote:
> I don't understand your reasoning here. If another process wants to
> access a page of the file which isn't currently in cache, it would have
> to first read the page in from storage. If it's under readahead, it
> has to wait for the read to finish. Why is the second case worse than
> the second? It seems better to me.
Thanks for your response! My worries is that, for example:
We read page 0, and trigger readahead to read n pages(0 - n-1). While in
another thread, we read page n-1.
In the current implementation, if readahead is in the process of reading
page 0 - n-2, later operation doesn't need to wait the former one to
finish. However, later operation will have to wait if we add all pages
to page cache first. And that is why I said it might cause problem for
performance overhead.
> At the same time, the iomap code is switched from ->readpages to
> ->readahead, so yes, the pages are added to the page cache.
Yes, it's not a problem in your implementation.
Thanks!
Yu Kuai
Powered by blists - more mailing lists