linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ext4: fix prefetchw of NULL page
@ 2019-03-31  8:11 Liu Xiang
  2019-04-07 15:55 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Xiang @ 2019-03-31  8:11 UTC (permalink / raw)
  To: linux-ext4; +Cc: linux-kernel, tytso, adilger.kernel, liuxiang_1999, Liu Xiang

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>
---

Changes in v2:
 remove prefetchw() when pages is NULL and change comment

 fs/ext4/readpage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c
index 6aa282e..f138c47 100644
--- a/fs/ext4/readpage.c
+++ b/fs/ext4/readpage.c
@@ -126,9 +126,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)))
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ext4: fix prefetchw of NULL page
  2019-03-31  8:11 [PATCH v2] ext4: fix prefetchw of NULL page Liu Xiang
@ 2019-04-07 15:55 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2019-04-07 15:55 UTC (permalink / raw)
  To: Liu Xiang; +Cc: linux-ext4, linux-kernel, adilger.kernel, liuxiang_1999

On Sun, Mar 31, 2019 at 04:11:34PM +0800, Liu Xiang wrote:
> 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.

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-07 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31  8:11 [PATCH v2] ext4: fix prefetchw of NULL page Liu Xiang
2019-04-07 15:55 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).