From: Mike Rapoport <rppt@kernel.org>
To: kernel test robot <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
David Hildenbrand <david@redhat.com>,
Wei Yang <richard.weiyang@gmail.com>,
linux-mm@kvack.org
Subject: Re: [linux-next:master] [mm/mm_init] 8a523d9e6f: BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c
Date: Mon, 25 Aug 2025 13:27:08 +0300 [thread overview]
Message-ID: <aKw6fG9eryVNmeEc@kernel.org> (raw)
In-Reply-To: <202508251443.f2d9f77f-lkp@intel.com>
Hi,
On Mon, Aug 25, 2025 at 03:01:12PM +0800, kernel test robot wrote:
>
> Hello,
>
> kernel test robot noticed "BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c" on:
>
> commit: 8a523d9e6f30349ad2f8c34d850483db905e976b ("mm/mm_init: use deferred_init_memmap_chunk() in deferred_grow_zone()")
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
>
> [test failed on linux-next/master 0f4c93f7eb861acab537dbe94441817a270537bf]
>
> in testcase: blktests
> version: blktests-x86_64-34a7fc4-1_20250824
> with following parameters:
>
> disk: 1SSD
> test: nvme-group-00
>
> config: x86_64-rhel-9.4-func
> compiler: gcc-12
> test machine: 192 threads 2 sockets Intel(R) Xeon(R) 6740E CPU @ 2.4GHz (Sierra Forest) with 256G memory
This patch should fix it:
diff --git a/mm/mm_init.c b/mm/mm_init.c
index f907dc17387d..c26f33fdd32b 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -2085,7 +2085,10 @@ deferred_init_memmap_chunk(unsigned long start_pfn, unsigned long end_pfn,
deferred_free_pages(spfn, chunk_end - spfn);
spfn = chunk_end;
- cond_resched();
+ if (irqs_disabled())
+ touch_nmi_watchdog();
+ else
+ cond_resched();
}
}
> (please refer to attached dmesg/kmsg for entire log/backtrace)
>
>
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <oliver.sang@intel.com>
> | Closes: https://lore.kernel.org/oe-lkp/202508251443.f2d9f77f-lkp@intel.com
>
>
> kern :err : [ 9.708923] BUG: sleeping function called from invalid context at mm/mm_init.c:2153
> kern :err : [ 9.709485] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 1, name: swapper/0
> kern :err : [ 9.709485] preempt_count: 1, expected: 0
> kern :err : [ 9.709485] RCU nest depth: 0, expected: 0
> kern :warn : [ 9.709485] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-rc1-00003-g8a523d9e6f30 #1 PREEMPT(voluntary)
> kern :warn : [ 9.709485] Hardware name: IEIT SYSTEMS NF5180-M8-A0-R0-00/NF5180-M8-A0-R0-00, BIOS 00.14.04 09/23/2024
> kern :warn : [ 9.709485] Call Trace:
> kern :warn : [ 9.709485] <TASK>
> kern :warn : [ 9.709485] dump_stack_lvl (lib/dump_stack.c:123 (discriminator 1))
> kern :warn : [ 9.709485] __might_resched (kernel/sched/core.c:8958)
> kern :warn : [ 9.709485] deferred_init_memmap_chunk (include/linux/sched.h:2070 mm/mm_init.c:2153)
> kern :warn : [ 9.709485] ? __pfx_deferred_init_memmap_chunk (mm/mm_init.c:2140)
> kern :warn : [ 9.709485] ? __pfx_try_to_claim_block (mm/page_alloc.c:2291)
> kern :warn : [ 9.709485] ? __pfx__raw_spin_lock_irqsave (kernel/locking/spinlock.c:161)
> kern :warn : [ 9.709485] ? _raw_spin_lock_irqsave (arch/x86/include/asm/atomic.h:107 include/linux/atomic/atomic-arch-fallback.h:2170 include/linux/atomic/atomic-instrumented.h:1302 include/asm-generic/qspinlock.h:111 include/linux/spinlock.h:187 include/linux/spinlock_api_smp.h:111 kernel/locking/spinlock.c:162)
> kern :warn : [ 9.709485] ? __pfx__raw_spin_lock_irqsave (kernel/locking/spinlock.c:161)
> kern :warn : [ 9.709485] ? rmqueue+0x8f7/0x29d0
> kern :warn : [ 9.709485] deferred_grow_zone (mm/mm_init.c:2286)
> kern :warn : [ 9.709485] get_page_from_freelist (mm/page_alloc.c:3824)
> kern :warn : [ 9.709485] __alloc_frozen_pages_noprof (mm/page_alloc.c:5148)
> kern :warn : [ 9.709485] ? __pfx___alloc_frozen_pages_noprof (mm/page_alloc.c:5114)
> kern :warn : [ 9.709485] ? __pfx_smp_call_function_many_cond (kernel/smp.c:784)
> kern :warn : [ 9.709485] __alloc_pages_noprof (mm/page_alloc.c:5182)
> kern :warn : [ 9.709485] dsalloc_pages (arch/x86/events/intel/ds.c:611)
> kern :warn : [ 9.709485] ? __asan_memset (mm/kasan/shadow.c:84)
> kern :warn : [ 9.709485] reserve_ds_buffers (arch/x86/events/intel/ds.c:631 arch/x86/events/intel/ds.c:789)
> kern :warn : [ 9.709485] x86_reserve_hardware (arch/x86/events/core.c:420 arch/x86/events/core.c:409)
> kern :warn : [ 9.709485] x86_pmu_event_init (arch/x86/events/core.c:673 arch/x86/events/core.c:2475)
> kern :warn : [ 9.709485] ? kmem_cache_alloc_node_noprof (arch/x86/include/asm/jump_label.h:46 include/linux/memcontrol.h:1714 mm/slub.c:2210 mm/slub.c:4190 mm/slub.c:4229 mm/slub.c:4281)
> kern :warn : [ 9.709485] perf_try_init_event (kernel/events/core.c:12581)
> kern :warn : [ 9.709485] perf_event_alloc (kernel/events/core.c:12680 kernel/events/core.c:12954)
> kern :warn : [ 9.709485] ? __pfx_watchdog_overflow_callback (kernel/watchdog_perf.c:107)
> kern :warn : [ 9.709485] perf_event_create_kernel_counter (kernel/events/core.c:13779 (discriminator 1))
> kern :warn : [ 9.709485] hardlockup_detector_event_create (kernel/watchdog_perf.c:133 (discriminator 3))
> kern :warn : [ 9.709485] watchdog_hardlockup_probe (kernel/watchdog_perf.c:267)
> kern :warn : [ 9.709485] lockup_detector_init (kernel/watchdog.c:1312)
> kern :warn : [ 9.709485] kernel_init_freeable (init/main.c:1571)
> kern :warn : [ 9.709485] ? __pfx_kernel_init (init/main.c:1461)
> kern :warn : [ 9.709485] kernel_init (init/main.c:1471)
> kern :warn : [ 9.709485] ? calculate_sigpending (kernel/signal.c:194)
> kern :warn : [ 9.709485] ? __pfx_kernel_init (init/main.c:1461)
> kern :warn : [ 9.709485] ret_from_fork (arch/x86/kernel/process.c:148)
> kern :warn : [ 9.709485] ? __pfx_kernel_init (init/main.c:1461)
> kern :warn : [ 9.709485] ret_from_fork_asm (arch/x86/entry/entry_64.S:258)
> kern :warn : [ 9.709485] </TASK>
>
>
> The kernel config and materials to reproduce are available at:
> https://download.01.org/0day-ci/archive/20250825/202508251443.f2d9f77f-lkp@intel.com
>
>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2025-08-25 10:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 7:01 kernel test robot
2025-08-25 10:27 ` Mike Rapoport [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=aKw6fG9eryVNmeEc@kernel.org \
--to=rppt@kernel.org \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=richard.weiyang@gmail.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