* [linux-next:master] [mm/mm_init] 8a523d9e6f: BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c
@ 2025-08-25 7:01 kernel test robot
2025-08-25 10:27 ` Mike Rapoport
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-08-25 7:01 UTC (permalink / raw)
To: Mike Rapoport
Cc: oe-lkp, lkp, David Hildenbrand, Wei Yang, linux-mm, oliver.sang
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
(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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-next:master] [mm/mm_init] 8a523d9e6f: BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c
2025-08-25 7:01 [linux-next:master] [mm/mm_init] 8a523d9e6f: BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c kernel test robot
@ 2025-08-25 10:27 ` Mike Rapoport
0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2025-08-25 10:27 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-lkp, lkp, David Hildenbrand, Wei Yang, linux-mm
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.
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-25 10:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 7:01 [linux-next:master] [mm/mm_init] 8a523d9e6f: BUG:sleeping_function_called_from_invalid_context_at_mm/mm_init.c kernel test robot
2025-08-25 10:27 ` Mike Rapoport
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).