[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200915075635.1112-1-yanfei.xu@windriver.com>
Date: Tue, 15 Sep 2020 15:56:35 +0800
From: <yanfei.xu@...driver.com>
To: <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/page_alloc.c: avoid inheritting current's flags when invoked in interrupt
From: Yanfei Xu <yanfei.xu@...driver.com>
alloc_mask shouldn't inherit the current task's flags when
__alloc_pages_nodemask is invoked in interrupt.
Signed-off-by: Yanfei Xu <yanfei.xu@...driver.com>
---
mm/page_alloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fab5e97dc9ca..388b587b35a8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4889,7 +4889,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid,
* from a particular context which has been marked by
* memalloc_no{fs,io}_{save,restore}.
*/
- alloc_mask = current_gfp_context(gfp_mask);
+ if (!in_interrupt())
+ alloc_mask = current_gfp_context(gfp_mask);
ac.spread_dirty_pages = false;
/*
--
2.18.2
Powered by blists - more mailing lists