lkml.org 
[lkml]   [2020]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/page_alloc.c: avoid inheritting current's flags when invoked in interrupt
On Tue, 15 Sep 2020 15:56:35 +0800 <yanfei.xu@windriver.com> wrote:

> From: Yanfei Xu <yanfei.xu@windriver.com>
>
> alloc_mask shouldn't inherit the current task's flags when
> __alloc_pages_nodemask is invoked in interrupt.
>
> ...
>
> --- 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;
>
> /*

hm, yes, and perhaps other callsites in page_alloc.c.

I assume this doesn't actually make any runtime difference? Because
gfp_mask in interrupt contexts isn't going to have __GFP_IO or __GFP_FS
anyway.

\
 
 \ /
  Last update: 2020-09-16 03:19    [W:0.037 / U:7.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site