lkml.org 
[lkml]   [2019]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ext4: do prefetchw while the page pointer has been updated
Date
When pages is not NULL, prefetchw(&page->flags) always works on
the last consumed page. This might do little improvment for handling
current page. It is better to do prefetchw while the page pointer
has just been updated.

Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
---
fs/ext4/readpage.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c
index 6aa282e..0b68dbe 100644
--- a/fs/ext4/readpage.c
+++ b/fs/ext4/readpage.c
@@ -126,14 +126,17 @@ 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)))
goto next_page;
- }
+ } else
+ prefetchw(&page->flags);
+

if (page_has_buffers(page))
goto confused;
--
1.9.1
\
 
 \ /
  Last update: 2019-03-03 09:22    [W:0.030 / U:3.524 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site