[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <857fa4e7-c529-40cf-9916-151d91e815c4@huawei.com>
Date: Sun, 19 Jan 2020 09:57:03 +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 9:42, Matthew Wilcox wrote:
> Did you read my patch series? The current code allocates pages,
> but does not put them in the page cache until after iomap is called.
> My patch series changes that to put the pages in the page cache as soon
> as they're allocated, and before iomap is called.
The current code to determin if page need to be allocated:
page = xa_load(&mapping->i_pages, page_offset);
if (page && !xa_is_value(page)) {
/*
┊* Page already present? Kick off the current batch of
┊* contiguous pages before continuing with the next
┊* batch.
┊*/
if (nr_pages)
read_pages(mapping, filp, &page_pool, nr_pages,
gfp_mask);
nr_pages = 0;
continue;
}
page = __page_cache_alloc(gfp_mask);
if (!page)
break;
Page will be allocated if the page do not exist in page cache. And I
don't see your patch series change that. Or am I missing something?
Thanks!
Yu Kuai
Powered by blists - more mailing lists