From: Vlastimil Babka <vbabka@suse.cz>
To: Matthew Wilcox <willy@infradead.org>,
kernel test robot <oliver.sang@intel.com>
Cc: Vishal Moola <vishal.moola@gmail.com>,
oe-lkp@lists.linux.dev, lkp@intel.com,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Uladzislau Rezki <urezki@gmail.com>,
linux-mm@kvack.org, Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [linus:master] [mm/vmalloc] a061578043: BUG:spinlock_trylock_failure_on_UP_on_CPU
Date: Mon, 22 Dec 2025 17:11:13 +0100 [thread overview]
Message-ID: <5a1721bc-e7e8-40e8-b2b9-c071d18a0112@suse.cz> (raw)
In-Reply-To: <aUXhy1Jyv7_GccIp@casper.infradead.org>
On 12/20/25 00:37, Matthew Wilcox wrote:
> On Fri, Dec 19, 2025 at 08:26:14PM +0000, Matthew Wilcox wrote:
>> Now, as I recall, we are very much doing this on purpose. We decided
>> not to disable interrupts at this point for improved interrupt
>> latency, accepting the possibility that we'd occasionally fail
>> the trylock. Except on UP that's now an assertion failure.
IIRC the primary motivation wasn't irq latency, it was to avoid IPIs for
remote drains. So the drain_pages_zone() can be in fact locking pcp of
another cpu, and any local operations on that cpu are then supposed to fail
their trylock (should be relatively rare). Disabling irqs would then make no
sense for protecting other cpu.
> This is stupid and wrong. If we have CONFIG_SMP=n and
> CONFIG_DEBUG_SPINLOCK=n, then trylock always succeeds. And we'll end
> up corrupting the data structure protected by the lock. So the warning
> is real, and we need to fix this.
That seems to be true and we should probably be doing spin_lock_irqsave() on
UP instead of spin_lock() in drain_pages_zone() and several other places.
Ideally via some wrappers like we have for the trylock operations that also
do some UP-specific stuff - pcp_spin_trylock() and pcp_spin_trylock().
> With my distro hat on, I do not give two hoots. We don't ship a nosmp
> kernel. I suspect all other distros (except maybe something targetting
> m68k?) are in the same boat.
Yeah seems the problem was introduced at 6.2 with commit 574907741599
("mm/page_alloc: leave IRQs enabled for per-cpu page allocations") or
something around that.
I'm off until Jan 5th so won't be developing a fix until then, but agree it
doesn't seem that urgent now.
prev parent reply other threads:[~2025-12-22 16:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 6:10 kernel test robot
2025-12-10 23:30 ` Vishal Moola (Oracle)
2025-12-11 10:09 ` Uladzislau Rezki
2025-12-11 13:40 ` Oliver Sang
2025-12-11 13:53 ` Oliver Sang
2025-12-11 20:52 ` Vishal Moola (Oracle)
2025-12-11 20:47 ` Andrew Morton
2025-12-11 21:01 ` Vishal Moola (Oracle)
2025-12-19 20:26 ` Matthew Wilcox
2025-12-19 23:37 ` Matthew Wilcox
2025-12-22 16:11 ` Vlastimil Babka [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=5a1721bc-e7e8-40e8-b2b9-c071d18a0112@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mgorman@techsingularity.net \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=urezki@gmail.com \
--cc=vishal.moola@gmail.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