Re: [PATCH v3 RFC 14/14] mm: speedup page alloc for MPOL_PREFERRED_MANY by adding a NO_SLOWPATH gfp bit

From: Feng Tang
Date: Wed Mar 10 2021 - 06:50:01 EST


On Wed, Mar 10, 2021 at 10:44:11AM +0100, Michal Hocko wrote:
> On Wed 10-03-21 13:19:47, Feng Tang wrote:
> [...]
> > diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> > index d66c1c0..00b19f7 100644
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -2205,9 +2205,13 @@ static struct page *alloc_pages_policy(struct mempolicy *pol, gfp_t gfp,
> > * | MPOL_PREFERRED_MANY (round 2) | local | NULL |
> > * +-------------------------------+---------------+------------+
> > */
> > - if (pol->mode == MPOL_PREFERRED_MANY)
> > + if (pol->mode == MPOL_PREFERRED_MANY) {
> > gfp_mask |= __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
> >
> > + /* Skip direct reclaim, as there will be a second try */
> > + gfp_mask &= ~__GFP_DIRECT_RECLAIM;
>
> __GFP_RETRY_MAYFAIL is a reclaim modifier which doesn't make any sense
> without __GFP_DIRECT_RECLAIM. Also I think it would be better to have a
> proper allocation flags in the initial patch which implements the
> fallback.

Ok, will remove the __GFP_RETRY_MAYFAIL setting and folder this with
previous patch(8/14).

Thanks,
Feng

> > + }
> > +
> > page = __alloc_pages_nodemask(gfp_mask, order,
> > policy_node(gfp, pol, preferred_nid),
> > policy_nodemask(gfp, pol));
> > --
> > 2.7.4
> >
> >
>
> --
> Michal Hocko
> SUSE Labs