lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs
On Tue, Jul 21, 2020 at 02:38:56PM +0200, Vlastimil Babka wrote:
> On 7/21/20 2:05 PM, Matthew Wilcox wrote:
> > On Tue, Jul 21, 2020 at 12:28:49PM +0900, js1304@gmail.com wrote:
> >> @@ -4619,8 +4631,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> >> wake_all_kswapds(order, gfp_mask, ac);
> >>
> >> reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);
> >> - if (reserve_flags)
> >> + if (reserve_flags) {
> >> alloc_flags = reserve_flags;
> >> + alloc_flags = current_alloc_flags(gfp_mask, alloc_flags);
> >> + }
> >
> > Is this right? Shouldn't you be passing reserve_flags to
> > current_alloc_flags() here? Also, there's no need to add { } here.
>
> Note the "alloc_flags = reserve_flags;" line is not being deleted here. But if
> it was, your points would be true, and yeah it would be a bit more tidy.

Oh ... I should wake up a little more.

Yeah, I'd recommend just doing this:

- alloc_flags = reserve_flags;
+ alloc_flags = current_alloc_flags(gfp_mask, reserve_flags);

\
 
 \ /
  Last update: 2020-07-21 14:43    [W:4.491 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site