From: Matthew Wilcox <willy@infradead.org>
To: NeilBrown <neilb@suse.de>
Cc: Kent Overstreet <kent.overstreet@linux.dev>,
Dave Chinner <david@fromorbit.com>,
Amir Goldstein <amir73il@gmail.com>,
paulmck@kernel.org, lsf-pc@lists.linux-foundation.org,
linux-mm@kvack.org, linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Jan Kara <jack@suse.cz>
Subject: Re: [Lsf-pc] [LSF/MM/BPF TOPIC] Reclamation interactions with RCU
Date: Mon, 4 Mar 2024 00:35:05 +0000 [thread overview]
Message-ID: <ZeUXORziOwkuB-tP@casper.infradead.org> (raw)
In-Reply-To: <170950594802.24797.17587526251920021411@noble.neil.brown.name>
On Mon, Mar 04, 2024 at 09:45:48AM +1100, NeilBrown wrote:
> I have in mind a more explicit statement of how much waiting is
> acceptable.
>
> GFP_NOFAIL - wait indefinitely
> GFP_KILLABLE - wait indefinitely unless fatal signal is pending.
> GFP_RETRY - may retry but deadlock, though unlikely, is possible. So
> don't wait indefinitely. May abort more quickly if fatal
> signal is pending.
> GFP_NO_RETRY - only try things once. This may sleep, but will give up
> fairly quickly. Either deadlock is a significant
> possibility, or alternate strategy is fairly cheap.
> GFP_ATOMIC - don't sleep - same as current.
I don't think these should be GFP flags. Rather, these should be
context flags (and indeed, they're mutually exclusive, so this is a
small integer to represent where we are on the spectrum). That is
we want code to do
void *alloc_foo(void)
{
return init_foo(kmalloc(256, GFP_MOVABLE));
}
void submit_foo(void)
{
spin_lock(&submit_lock);
flags = memalloc_set_atomic();
__submit_foo(alloc_foo());
memalloc_restore_flags(flags);
spin_unlock(&submit_lock);
}
struct foo *prealloc_foo(void)
{
return alloc_foo();
}
... for various degrees of complexity. That is, the _location_ of memory
is allocation site knowledge, but how hard to try is _path_ dependent,
and not known at the allocation site because it doesn't know what locks
are held.
next prev parent reply other threads:[~2024-03-04 0:35 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 18:56 [LSF/MM/BPF TOPIC] Reclamation interactions with RCU Paul E. McKenney
2024-02-27 19:19 ` [Lsf-pc] " Amir Goldstein
2024-02-27 22:59 ` Paul E. McKenney
2024-03-01 3:28 ` Kent Overstreet
2024-03-05 2:43 ` Paul E. McKenney
2024-03-05 2:56 ` Yosry Ahmed
2024-02-28 19:37 ` Matthew Wilcox
2024-02-29 1:29 ` Dave Chinner
2024-02-29 4:20 ` Kent Overstreet
2024-02-29 4:17 ` Kent Overstreet
2024-02-29 4:24 ` Matthew Wilcox
2024-02-29 4:44 ` Kent Overstreet
2024-03-01 2:16 ` NeilBrown
2024-03-01 2:39 ` Kent Overstreet
2024-03-01 2:48 ` Matthew Wilcox
2024-03-01 3:09 ` Kent Overstreet
2024-03-01 3:33 ` James Bottomley
2024-03-01 3:52 ` Kent Overstreet
2024-03-01 4:01 ` Kent Overstreet
2024-03-01 4:09 ` NeilBrown
2024-03-01 4:18 ` Kent Overstreet
2024-03-01 4:18 ` James Bottomley
2024-03-01 4:08 ` James Bottomley
2024-03-01 4:15 ` Kent Overstreet
2024-03-05 2:54 ` Yosry Ahmed
2024-03-01 5:54 ` Dave Chinner
2024-03-01 20:20 ` Kent Overstreet
2024-03-01 23:47 ` NeilBrown
2024-03-02 0:02 ` Kent Overstreet
2024-03-02 11:33 ` Tetsuo Handa
2024-03-02 16:53 ` Matthew Wilcox
2024-03-03 22:45 ` NeilBrown
2024-03-03 22:54 ` Kent Overstreet
2024-03-04 0:20 ` Dave Chinner
2024-03-04 1:16 ` NeilBrown
2024-03-04 0:35 ` Matthew Wilcox [this message]
2024-03-04 1:27 ` NeilBrown
2024-03-04 2:05 ` Kent Overstreet
2024-03-12 14:46 ` Vlastimil Babka
2024-03-12 22:09 ` NeilBrown
2024-03-20 18:32 ` Dan Carpenter
2024-03-20 18:48 ` Vlastimil Babka
2024-03-20 18:55 ` Matthew Wilcox
2024-03-20 19:07 ` Kent Overstreet
2024-03-20 19:14 ` Matthew Wilcox
2024-03-20 19:33 ` Kent Overstreet
2024-03-20 19:09 ` Kent Overstreet
2024-03-21 6:27 ` Dan Carpenter
2024-03-22 1:47 ` NeilBrown
2024-03-22 6:13 ` Dan Carpenter
2024-03-24 22:31 ` NeilBrown
2024-03-25 8:43 ` Dan Carpenter
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=ZeUXORziOwkuB-tP@casper.infradead.org \
--to=willy@infradead.org \
--cc=amir73il@gmail.com \
--cc=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=kent.overstreet@linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=neilb@suse.de \
--cc=paulmck@kernel.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.