diff options
author | Liu Xiang <liu.xiang6@zte.com.cn> | 2019-04-07 11:54:27 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-04-07 11:54:27 -0400 |
commit | d454a27384f6eb05904a59d1607461b7ad312aa9 (patch) | |
tree | 691f6aca919e9a53777be7cbffeb3b87c694c314 /fs | |
parent | 742b06b5628f2cd23cb51a034cb54dc33c6162c5 (diff) | |
download | linux-d454a27384f6eb05904a59d1607461b7ad312aa9.tar.bz2 |
ext4: fix prefetchw of NULL page
In ext4_mpage_readpages(), if the parameter pages is not NULL, another
parameter page is NULL. At the first time prefetchw(&page->flags)
works on NULL. From second time, prefetchw(&page->flags) always works on
the last consumed page. This might do little improvment for handling
current page. So prefetchw() should be called while the page pointer
has just been updated.
Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/readpage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 3adadf461825..9386b0446afb 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -127,9 +127,10 @@ int ext4_mpage_readpages(struct address_space *mapping, int fully_mapped = 1; unsigned first_hole = blocks_per_page; - prefetchw(&page->flags); if (pages) { page = lru_to_page(pages); + + prefetchw(&page->flags); list_del(&page->lru); if (add_to_page_cache_lru(page, mapping, page->index, readahead_gfp_mask(mapping))) |