lkml.org 
[lkml]   [2020]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] iomap: fix race between readahead and direct write
From
Date


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

\
 
 \ /
  Last update: 2020-01-19 02:57    [W:0.072 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site