lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] mm: reduce noise in show_mem for lowmem allocations
On Thu 01-09-22 16:14:39, Vlastimil Babka wrote:
> On 8/30/22 09:34, Michal Hocko wrote:
> > [Cc Dan]
> > Dan has brought up[1] that the use of gfp mask has confused his static
> > analyzer which assumes that GFP_HIGHUSER_MOVABLE implies a sleeping
> > allocation and that wouldn't be a great idea from the panic path. I
> > would add that most callers of this function would be really bad to
> > allocate.
> >
> > The report itself is a false positive but it made me think a bit about
> > this. Even if the check is too simplistic I guess it resembles how many
> > developers are thinking (including me). If I see GFP_HIGHUSER_MOVABLE or
> > GF_KERNEL I automatically assume a sleeping allocation down the road.
> > And who know somebody might add one in the future even into show_mem
> > because the gfp parameter would be too tempting to not (ab)use.
> >
> > My original intention was to use a natural allocation speak but this can
> > backfire so maybe it would be better to give the argument its real
> > meaning and that is the high_zone_idx. This is cryptic for code outside
> > of MM but that is not all that many callers and we can hide this fact
> > from them. In other words does the thing below looks better (incremental
> > for illustration, I will make it a proper patch if yes)?
>
> Yeah, looks better to me this way. Thanks!

Thanks for looking into this. Unless somebody objects I will send a
consolidated patch early next week.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2022-09-01 21:19    [W:0.041 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site