linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-mm@kvack.org, Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	"Darrick J . Wong" <djwong@kernel.org>
Subject: Re: [PATCH 2/2] mm: introduce PF_MEMALLOC_NOWARN
Date: Thu, 1 Feb 2024 16:59:07 +0100	[thread overview]
Message-ID: <Zbu_yyChbCO6b2Lj@tiehlicka> (raw)
In-Reply-To: <3lzd24v653hn7ks6ocdeos6xkppk5l7pgun7nysmmmsfgrjob3@mqynwkythb4d>

On Thu 01-02-24 06:03:27, Kent Overstreet wrote:
> On Mon, Jan 29, 2024 at 11:48:00AM +0100, Michal Hocko wrote:
[...]
> >From 0e87e55058ccddde4b6bcc092f43e66a4e632575 Mon Sep 17 00:00:00 2001
> From: Kent Overstreet <kent.overstreet@linux.dev>
> Date: Thu, 25 Jan 2024 19:00:24 -0500
> Subject: [PATCH] mm: introduce PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN
> 
> Introduce PF_MEMALLOC_* equivalents of some GFP_ flags:
> 
> PF_MEMALLOC_NORECLAIM	-> GFP_NOWAIT

scoped NOWAIT/NORECLAIM semantic has been proposed in the past. I
haven't been fan of it TBH. This is really tricky because unlike other
scoped flags this changes the allocation failure semantic for the code
that is not really aware of that. Even worse if the code inside the
scope has a completely different allocation failure requirements - e.g.
consider a nested GFP_NOFAIL request. Your implementation would simply
override that and cause an unexpected failure. Now you could exclude
GFP_NOFAIL explicitly but that brings more problems down the road - e.g.
consider the scope NOWAIT is a way to prevent from sleeping from within
atomic context. Now nested GFP_NOFAIL request either busy waits or
sleeps inside of an atomic context. No good!

-- 
Michal Hocko
SUSE Labs


      reply	other threads:[~2024-02-01 15:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 22:07 [PATCH 1/2] mm: introduce memalloc_flags_{save,restore} Kent Overstreet
2024-01-26 22:07 ` [PATCH 2/2] mm: introduce PF_MEMALLOC_NOWARN Kent Overstreet
2024-01-28 15:45   ` Michal Hocko
2024-01-28 19:43     ` Kent Overstreet
2024-01-29 10:48       ` Michal Hocko
2024-02-01 11:03         ` Kent Overstreet
2024-02-01 15:59           ` Michal Hocko [this message]

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=Zbu_yyChbCO6b2Lj@tiehlicka \
    --to=mhocko@suse.com \
    --cc=djwong@kernel.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).