From: Kent Overstreet <kent.overstreet@linux.dev>
To: Michal Hocko <mhocko@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH] bcachefs: Switch to memalloc_flags_do() for vmalloc allocations
Date: Wed, 28 Aug 2024 18:58:43 -0400 [thread overview]
Message-ID: <xxs3s22qmlzby3ligct7x5a3fbzzjfdqqt7unmpih64dk3kdyx@vml4m27gpujw> (raw)
In-Reply-To: <Zs959Pa5H5WeY5_i@tiehlicka>
On Wed, Aug 28, 2024 at 09:26:44PM GMT, Michal Hocko wrote:
> On Wed 28-08-24 15:11:19, Kent Overstreet wrote:
> > On Wed, Aug 28, 2024 at 07:48:43PM GMT, Matthew Wilcox wrote:
> > > On Wed, Aug 28, 2024 at 10:06:36AM -0400, Kent Overstreet wrote:
> > > > vmalloc doesn't correctly respect gfp flags - gfp flags aren't used for
> > > > pte allocation, so doing vmalloc/kvmalloc allocations with reclaim
> > > > unsafe locks is a potential deadlock.
> > >
> > > Kent, the approach you've taken with this was NACKed. You merged it
> > > anyway (!). Now you're spreading this crap further, presumably in an effort
> > > to make it harder to remove.
> >
> > Excuse me? This is fixing a real issue which has been known for years.
>
> If you mean a lack of GFP_NOWAIT support in vmalloc then this is not a
> bug but a lack of feature. vmalloc has never promissed to support this
> allocation mode and a scoped gfp flag will not magically make it work
> because there is a sleeping lock involved in an allocation path in some
> cases.
>
> If you really need this feature to be added then you should clearly
> describe your usecase and listen to people who are familiar with the
> vmalloc internals rather than heavily pushing your direction which
> doesn't work anyway.
Michal, I'm plenty familiar with the vmalloc internals. Given that you
didn't even seem to be aware of how it doesn't respect gfp flags, you
seem to be the person who hasn't been up to speed in this discussion.
> > It was decided _years_ ago that PF_MEMALLOC flags were how this was
> > going to be addressed.
>
> Nope! It has been decided that _some_ gfp flags are acceptable to be used
> by scoped APIs. Most notably NOFS and NOIO are compatible with reclaim
> modifiers and other flags so these are indeed safe to be used that way.
Decided by who?
Cite the list discussion, and the reasoning.
> > > Stop it. Work with us to come up with an acceptable approach. I
> > > think there is one that will work, but you need to listen to the people
> > > who're giving you feedback because Linux is too big of a code-base for
> > > you to understand everything.
> >
> > No, you guys need to stop pushing broken shit.
>
> This is not the way to work with other people. Seriously!
No, your patches and the reasoning you've been pushing are broken.
A safe interface is not one that "does not fail", a safe interface is
one that never invokes undefined behaviour - and generally that means
it'll return an error instead.
And programming in the kernel means that you check for errors, period.
This idea that you have of "safety" meaning "we'll just conveniently
remove or ignore the cases where GFP_NOFAIL would have to fail" is
complete and utter garbage.
next prev parent reply other threads:[~2024-08-28 22:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 14:06 Kent Overstreet
2024-08-28 18:48 ` Matthew Wilcox
2024-08-28 19:11 ` Kent Overstreet
2024-08-28 19:26 ` Michal Hocko
2024-08-28 22:58 ` Kent Overstreet [this message]
2024-08-29 7:19 ` Michal Hocko
2024-08-29 11:41 ` Kent Overstreet
2024-08-29 11:08 ` Michal Hocko
2024-08-29 11:55 ` Kent Overstreet
2024-08-29 12:34 ` Michal Hocko
2024-08-29 12:42 ` Kent Overstreet
2024-08-29 14:27 ` Dave Chinner
2024-08-30 3:39 ` Theodore Ts'o
2024-08-31 15:46 ` Kent Overstreet
2024-08-30 9:14 ` Yafang Shao
2024-08-30 15:25 ` Vlastimil Babka
2024-09-02 3:00 ` Yafang Shao
2024-09-01 3:35 ` Dave Chinner
2024-09-02 3:02 ` Yafang Shao
2024-09-02 8:11 ` Michal Hocko
2024-09-02 9:01 ` Yafang Shao
2024-09-02 9:09 ` Michal Hocko
2024-09-03 6:34 ` Yafang Shao
2024-09-03 7:18 ` Michal Hocko
2024-09-03 12:44 ` Theodore Ts'o
2024-09-03 13:15 ` Yafang Shao
2024-09-03 14:03 ` Michal Hocko
2024-09-03 13:30 ` Michal Hocko
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=xxs3s22qmlzby3ligct7x5a3fbzzjfdqqt7unmpih64dk3kdyx@vml4m27gpujw \
--to=kent.overstreet@linux.dev \
--cc=dchinner@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--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