Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932755AbbKMLrp (ORCPT ); Fri, 13 Nov 2015 06:47:45 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33879 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932553AbbKMLro (ORCPT ); Fri, 13 Nov 2015 06:47:44 -0500 From: yalin wang To: akpm@linux-foundation.org, mhocko@suse.cz, vbabka@suse.cz, vdavydov@parallels.com, hannes@cmpxchg.org, mgorman@techsingularity.net, yalin.wang2010@gmail.com, tj@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: change may_enter_fs check condition Date: Fri, 13 Nov 2015 19:47:35 +0800 Message-Id: <1447415255-832-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1018 Lines: 30 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 --- 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/