linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: change may_enter_fs check condition
@ 2015-11-13 11:47 yalin wang
  2015-11-13 12:01 ` Vlastimil Babka
  0 siblings, 1 reply; 4+ messages in thread
From: yalin wang @ 2015-11-13 11:47 UTC (permalink / raw)
  To: akpm, mhocko, vbabka, vdavydov, hannes, mgorman, yalin.wang2010,
	tj, linux-mm, linux-kernel

Add page_is_file_cache() for __GFP_FS check,
otherwise, a Pageswapcache() && PageDirty() page can always be write
back if the gfp flag is __GFP_FS, this is not the expected behavior.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index bd2918e..f8fc8c1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -930,7 +930,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 		if (page_mapped(page) || PageSwapCache(page))
 			sc->nr_scanned++;
 
-		may_enter_fs = (sc->gfp_mask & __GFP_FS) ||
+		may_enter_fs = (page_is_file_cache(page) && (sc->gfp_mask & __GFP_FS)) ||
 			(PageSwapCache(page) && (sc->gfp_mask & __GFP_IO));
 
 		/*
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2015-11-16  1:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 11:47 [PATCH] mm: change may_enter_fs check condition yalin wang
2015-11-13 12:01 ` Vlastimil Babka
2015-11-13 15:36   ` Michal Hocko
2015-11-16  1:38     ` yalin wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox