From: Uladzislau Rezki <urezki@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Uladzislau Rezki <urezki@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"Liam R. Howlett (Google)" <liam@infradead.org>,
Michal Hocko <mhocko@suse.com>, Baoquan He <bhe@redhat.com>,
Alexander Potapenko <glider@google.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Marco Elver <elver@google.com>, Michal Hocko <mhocko@kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Graf <tgraf@suug.ch>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
maple-tree@lists.infradead.org, Lorenzo Stoakes <ljs@kernel.org>,
Chris Mason <mason@kernel.org>, Alice Ryhl <aliceryhl@google.com>,
Andrew Ballance <andrewjballance@gmail.com>,
stable@vger.kernel.org,
"David Hildenbrand (Arm)" <david@kernel.org>
Subject: Re: [PATCH 4/4] rhashtable: fix vmalloc() deadlock in atomic rehash
Date: Mon, 2 Nov 2026 12:18:09 +0100 [thread overview]
Message-ID: <auhxcS4rtrPG3tVF@pc636> (raw)
In-Reply-To: <auTrzlSFCWNJYisW@casper.infradead.org>
Hello, Matthew!
> On Fri, Oct 30, 2026 at 10:52:37AM +0100, Uladzislau Rezki wrote:
> > The problem with spin_lock_irqsave() is that vmalloc() path can take
> > time to alloc and map pages. I am not sure this is worth to switch to
> > irq-save locking primitive. So this is the "heaviest" allocator in the
> > kernel. Callers have to be careful how the call vmalloc().
> >
> > IMO, this caller has to be fixed.
>
> Which caller, though? Are you saying rhashtable_insert_rehash()
> needs to call kmalloc() instead of kvmalloc()?
>
The problem is that we used to BUG_ON() in vmalloc if soft-irq or BH
is disabled, i.e. for vmalloc it is incorrect state.
See https://lore.kernel.org/all/69ff8c7c.050a0220.1036b8.000b.GAE@google.com/
Two patches to address this:
1. https://lore.kernel.org/all/20260515153009.2296191-1-urezki@gmail.com/
2. https://lore.kernel.org/all/20261026102503.30860-1-urezki@gmail.com/
second can be updated and resent as it checks if the context does soft
irq processing whereas it allows:
bh-disable;
vmalloc();
forbidding this will address the rhashtable deadlock(discussed here) but
this will just fail allocation because it is incorrect state for vmalloc
and calling kvmalloc() for rhashtable will not succeed.
i.e. rhashtable context should be fixed also. This is what i meant by
saying: this caller has to be fixed.
--
Uladzislau Rezki
next prev parent reply other threads:[~2026-11-02 11:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 15:42 [PATCH 0/4] Lib fixes for 7.3 Liam R. Howlett (Google)
2026-10-28 15:42 ` [PATCH 1/4] maple_tree: Fix rcu reader NULL dereference after the tree is emptied Liam R. Howlett (Google)
2026-10-28 15:42 ` [PATCH 2/4] maple_tree: Test emptying tree while RCU reading Liam R. Howlett (Google)
2026-10-28 15:42 ` [PATCH 3/4] maple_tree: Update internal warning and bug_on code Liam R. Howlett (Google)
2026-10-28 17:54 ` Lorenzo Stoakes (ARM)
2026-10-28 18:37 ` Liam R. Howlett (Google)
2026-10-28 15:42 ` [PATCH 4/4] rhashtable: fix vmalloc() deadlock in atomic rehash Liam R. Howlett (Google)
2026-10-29 2:16 ` Herbert Xu
2026-10-29 10:08 ` Uladzislau Rezki
2026-10-29 14:53 ` Liam R. Howlett (Google)
2026-10-29 16:23 ` Michal Hocko
2026-10-30 4:48 ` Herbert Xu
2026-10-30 9:52 ` Uladzislau Rezki
2026-10-30 19:11 ` Matthew Wilcox
2026-11-02 11:18 ` Uladzislau Rezki [this message]
2026-10-31 0:56 ` Liam R. Howlett (Google)
2026-11-01 0:19 ` Herbert Xu
2026-11-03 1:49 ` Liam R. Howlett (Google)
2026-10-29 20:02 ` Matthew Wilcox
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=auhxcS4rtrPG3tVF@pc636 \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aliceryhl@google.com \
--cc=andrewjballance@gmail.com \
--cc=bhe@redhat.com \
--cc=david@kernel.org \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=liam@infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=maple-tree@lists.infradead.org \
--cc=mason@kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=ryabinin.a.a@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tgraf@suug.ch \
--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
all inboxes | Powered by JetHome®