All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Uladzislau Rezki <urezki@gmail.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, Baoquan He <bhe@redhat.com>
Subject: Re: [RFC 2/7] mm/vmalloc: Support non-blocking GFP flags in alloc_vmap_area()
Date: Tue, 8 Jul 2025 18:45:50 +0200	[thread overview]
Message-ID: <aG1LPktW1l3IKjEb@pc636> (raw)
In-Reply-To: <aG02jeuCSPUFBx7C@tiehlicka>

On Tue, Jul 08, 2025 at 05:17:33PM +0200, Michal Hocko wrote:
> On Tue 08-07-25 14:34:28, Uladzislau Rezki wrote:
> > On Mon, Jul 07, 2025 at 09:11:35AM +0200, Michal Hocko wrote:
> > > On Fri 04-07-25 17:25:32, Uladzislau Rezki wrote:
> > > [...]
> > > > @@ -2030,7 +2033,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
> > > >  	 */
> > > >  	va = node_alloc(size, align, vstart, vend, &addr, &vn_id);
> > > >  	if (!va) {
> > > > -		gfp_mask = gfp_mask & GFP_RECLAIM_MASK;
> > > > +		if (allow_block)
> > > > +			gfp_mask = gfp_mask & GFP_RECLAIM_MASK;
> > > 
> > > I don't follow here and is this even correct?
> > > 
> > Allow nested flags to follow a user request if there is a request
> > to not block. For example if we apply GFP_RECLAIM_MASK to GFP_ATOMIC
> > GFP_ATOMIC is converted to zero, thus to GFP_NOWAIT.
> 
> I still do not follow. The aim of this code is to filter out all
> non-reclaim related flags. Why that should work differently for
> non-waiting allocations?
> Btw. if you had GPP_ATOMIC the resulting mask will be still GFP_ATOMIC
> as both __GFP_HIGH|__GFP_KSWAPD_RECLAIM are part of GFP_RECLAIM_MASK.
> 
Right. I misread the GFP_RECLAIM_MASK, i thought that GFP_ATOMIC and
GFP_NOWAIT are not part of it. They allow reclaim, but not direct,
i.e. it is OK to wake-up a kswapd.

So, they should not work differently. Thank you for the comment! 

--
Uladzislau Rezki


  reply	other threads:[~2025-07-08 16:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 15:25 [RFC 0/7] vmallloc and non-blocking GFPs Uladzislau Rezki (Sony)
2025-07-04 15:25 ` [RFC 1/7] lib/test_vmalloc: Add non-block-alloc-test case Uladzislau Rezki (Sony)
2025-07-08  5:59   ` [External] " Adrian Huang12
2025-07-08  8:29     ` Uladzislau Rezki
2025-07-04 15:25 ` [RFC 2/7] mm/vmalloc: Support non-blocking GFP flags in alloc_vmap_area() Uladzislau Rezki (Sony)
2025-07-07  7:11   ` Michal Hocko
2025-07-08 12:34     ` Uladzislau Rezki
2025-07-08 15:17       ` Michal Hocko
2025-07-08 16:45         ` Uladzislau Rezki [this message]
2025-07-04 15:25 ` [RFC 3/7] mm/vmalloc: Avoid cond_resched() when blocking is not permitted Uladzislau Rezki (Sony)
2025-07-07  7:11   ` Michal Hocko
2025-07-08 12:29     ` Uladzislau Rezki
2025-07-04 15:25 ` [RFC 4/7] mm/kasan, mm/vmalloc: Respect GFP flags in kasan_populate_vmalloc() Uladzislau Rezki (Sony)
2025-07-07  1:47   ` Baoquan He
2025-07-08  1:15     ` Baoquan He
2025-07-08  8:30       ` Uladzislau Rezki
2025-07-04 15:25 ` [RFC 5/7] mm/vmalloc: Defer freeing partly initialized vm_struct Uladzislau Rezki (Sony)
2025-07-04 15:25 ` [RFC 6/7] mm/vmalloc: Support non-blocking GFP flags in __vmalloc_area_node() Uladzislau Rezki (Sony)
2025-07-07  7:13   ` Michal Hocko
2025-07-08 12:27     ` Uladzislau Rezki
2025-07-08 15:22       ` Michal Hocko
2025-07-09 11:20         ` Uladzislau Rezki
2025-07-08 15:47   ` Michal Hocko
2025-07-09 13:45     ` Uladzislau Rezki
2025-07-04 15:25 ` [RFC 7/7] mm: Drop __GFP_DIRECT_RECLAIM flag if PF_MEMALLOC is set Uladzislau Rezki (Sony)

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=aG1LPktW1l3IKjEb@pc636 \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    /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.