linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: use in_task() in alloc_pages()
@ 2021-08-09  7:51 Vasily Averin
  0 siblings, 0 replies; only message in thread
From: Vasily Averin @ 2021-08-09  7:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, kernel

obsoleted in_interrupt() includes task context with enabled BH,
it's better to use in_task() instead.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index e32360e..2f8ee67 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2231,7 +2231,7 @@ struct page *alloc_pages(gfp_t gfp, unsigned order)
 	struct mempolicy *pol = &default_policy;
 	struct page *page;
 
-	if (!in_interrupt() && !(gfp & __GFP_THISNODE))
+	if (in_task() && !(gfp & __GFP_THISNODE))
 		pol = get_task_policy(current);
 
 	/*
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-09  7:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  7:51 [PATCH] mm: use in_task() in alloc_pages() Vasily Averin

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