Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs

From: Joonsoo Kim
Date: Wed Jul 22 2020 - 21:38:30 EST


2020ë 7ì 21ì (í) ìí 9:39, Vlastimil Babka <vbabka@xxxxxxx>ëì ìì:
>
> On 7/21/20 2:05 PM, Matthew Wilcox wrote:
> > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1304@xxxxxxxxx wrote:
> >> +static inline unsigned int current_alloc_flags(gfp_t gfp_mask,
> >> + unsigned int alloc_flags)
> >> +{
> >> +#ifdef CONFIG_CMA
> >> + unsigned int pflags = current->flags;
> >> +
> >> + if (!(pflags & PF_MEMALLOC_NOCMA) &&
> >> + gfp_migratetype(gfp_mask) == MIGRATE_MOVABLE)
> >> + alloc_flags |= ALLOC_CMA;
> >
> > Please don't indent by one tab when splitting a line because it looks like
> > the second line and third line are part of the same block. Either do
> > this:
> >
> > if (!(pflags & PF_MEMALLOC_NOCMA) &&
> > gfp_migratetype(gfp_mask) == MIGRATE_MOVABLE)
> > alloc_flags |= ALLOC_CMA;
> >
> > or this:
> > if (!(pflags & PF_MEMALLOC_NOCMA) &&
> > gfp_migratetype(gfp_mask) == MIGRATE_MOVABLE)
> > alloc_flags |= ALLOC_CMA;
>
> Ah, good point.

Will change it.

Thanks.