From: Thomas Gleixner <tglx@linutronix.de>
To: Vlastimil Babka <vbabka@suse.cz>,
kernel test robot <oliver.sang@intel.com>,
Shanker Donthineni <sdonthineni@nvidia.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
linux-kernel@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
Michael Walle <michael@walle.cc>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Hans de Goede <hdegoede@redhat.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-mm@kvack.org, "Liam R. Howlett" <Liam.Howlett@oracle.com>,
Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH 5/5] genirq: Use the maple tree for IRQ descriptors management
Date: Mon, 06 Feb 2023 19:10:02 +0100 [thread overview]
Message-ID: <87lelay8at.ffs@tglx> (raw)
In-Reply-To: <9a682773-df56-f36c-f582-e8eeef55d7f8@suse.cz>
On Mon, Feb 06 2023 at 15:24, Vlastimil Babka wrote:
> On 2/1/23 14:27, Thomas Gleixner wrote:
>> This triggers because __kmem_cache_alloc_bulk() uses
>> lock_irq()/unlock_irq(). Seems nobody used it during early boot stage
>> yet. Though the maple tree conversion of the interrupt descriptor
>> storage which is the purpose of the patch in question makes that happen.
>>
>> Fix below.
>
> Looks like it should work. But I think we also need to adjust SLAB's
> mm/slab.c kmem_cache_alloc_bulk() which does local_irq_disable(); /
> local_irq_enable(); right?
Yup.
> Also if we enter this with IRQ's disabled, then we should take care about
> the proper gfp flags. Looking at the patch [1] I see
>
> WARN_ON(mas_store_gfp(&mas, desc, GFP_KERNEL) != 0);
>
> so GFP_KERNEL would be wrong with irqs disabled, looks like a case for
> GFP_ATOMIC.
> OTOH I can see the thing it replaces was:
>
> static RADIX_TREE(irq_desc_tree, GFP_KERNEL);
>
> so that's also a GFP_KERNEL and we haven't seen debug splats from
> might_alloc() checks before in this code?. That's weird, or maybe the
> case
might_alloc()
might_sleep_if()
__might_sleep()
WARN_ON(task->state != RUNNING); <- Does not trigger
__might_resched()
if (.... || system_state == SYSTEM_BOOTING || ...)
return;
As system_state is SYSTEM_BOOTING at this point the splats are not
happening.
> of "we didn't enable irqs yet on this cpu being bootstrapped" is handled
> differently than "we have temporarily disabled irqs"? Sure, during early
> boot we should have all the memory and no need to reclaim...
The point is that interrupts are fully disabled during early boot and
there is no scheduler so there is no scheduling possible.
Quite some code in the kernel relies on GFP_KERNEL being functional
during that early boot stage. If the kernel runs out of memory that
early, then the chance of recovery is exactly 0.
Thanks,
tglx
next prev parent reply other threads:[~2023-02-06 18:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202302011308.f53123d2-oliver.sang@intel.com>
2023-02-01 13:27 ` [PATCH 5/5] genirq: Use the maple tree for IRQ descriptors management Thomas Gleixner
2023-02-06 14:24 ` Vlastimil Babka
2023-02-06 18:10 ` Thomas Gleixner [this message]
2023-02-07 10:30 ` Thomas Gleixner
2023-02-07 14:16 ` mm, slab/slub: Ensure kmem_cache_alloc_bulk() is available early Thomas Gleixner
2023-02-07 14:45 ` Vlastimil Babka
2023-02-07 14:47 ` Vlastimil Babka
2023-02-07 18:20 ` Thomas Gleixner
2023-02-08 9:15 ` Vlastimil Babka
2023-02-08 20:46 ` Thomas Gleixner
2023-02-09 20:28 ` Matthew Wilcox
2023-02-09 23:19 ` Thomas Gleixner
2023-02-08 13:20 ` Hyeonggon Yoo
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=87lelay8at.ffs@tglx \
--to=tglx@linutronix.de \
--cc=Liam.Howlett@oracle.com \
--cc=bigeasy@linutronix.de \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=maz@kernel.org \
--cc=michael@walle.cc \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=sdonthineni@nvidia.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=wsa+renesas@sang-engineering.com \
/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).