All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonsoo Kim <js1304@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-team@lge.com, Christoph Hellwig <hch@infradead.org>,
	Roman Gushchin <guro@fb.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Michal Hocko <mhocko@suse.com>,
	"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs
Date: Thu, 23 Jul 2020 10:42:44 +0900	[thread overview]
Message-ID: <CAAmzW4NSQi016QH4rwZ4d5nCfS+9bpRZGd0wovaUSWnuySTvoQ@mail.gmail.com> (raw)
In-Reply-To: <20200721124312.GE15516@casper.infradead.org>

2020년 7월 21일 (화) 오후 9:43, Matthew Wilcox <willy@infradead.org>님이 작성:
>
> 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);

Okay. I will change it. Just note that the reason that I added it
separately is that
I think that separation is more readable since we can easily notice
that alloc_flags
is changed to reserve_flags without inspecting currect_alloc_flags() function.

Thanks.

  reply	other threads:[~2020-07-23  1:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  3:28 [PATCH] mm/page_alloc: fix memalloc_nocma_{save/restore} APIs js1304
2020-07-21  9:17 ` Vlastimil Babka
2020-07-21 12:05 ` Matthew Wilcox
2020-07-21 12:38   ` Vlastimil Babka
2020-07-21 12:43     ` Matthew Wilcox
2020-07-23  1:42       ` Joonsoo Kim [this message]
2020-07-23  1:42         ` Joonsoo Kim
2020-07-23  1:38     ` Joonsoo Kim
2020-07-23  1:38       ` Joonsoo Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAmzW4NSQi016QH4rwZ4d5nCfS+9bpRZGd0wovaUSWnuySTvoQ@mail.gmail.com \
    --to=js1304@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=guro@fb.com \
    --cc=hch@infradead.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=stable@vger.kernel.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.