lkml.org 
[lkml]   [2021]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] mm/page_alloc: detect allocation forbidden by cpuset and bail out early
On Tue 14-09-21 10:01:26, Vlastimil Babka wrote:
> On 9/14/21 05:40, Feng Tang wrote:
[...]
> > +/* Whether the 'nodes' are all movable nodes */
> > +static inline bool movable_only_nodes(nodemask_t *nodes)
> > +{
> > + struct zonelist *zonelist;
> > + struct zoneref *z;
> > +
> > + if (nodes_empty(*nodes))
> > + return false;
> > +
> > + zonelist =
> > + &NODE_DATA(first_node(*nodes))->node_zonelists[ZONELIST_FALLBACK];
> > + z = first_zones_zonelist(zonelist, ZONE_NORMAL, nodes);
> > + return (!z->zone) ? true : false;
> > +}
>
> Hmm, could all that become just this?
>
> !nodes_intersects(&node_states[N_NORMAL_MEMORY], nodes)

Maybe yes but I find the zonelist approach much easier to follow even
though the code looks more complex at first sight. It talks about an
empty zone list for ZONE_NORMAL request which is quite clear from the
scribble. I always have to re-learn how the N*MEMORY works TBH. Maybe
this is just me though.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-09-14 10:18    [W:0.229 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site