Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.1-rt3.tar.xz There are "valid" GFP_ATOMIC allocations such as |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 2130, name: tar |1 lock held by tar/2130: | #0: (&mm->mmap_sem){++++++}, at: [] SyS_brk+0x39/0x190 |Preemption disabled at:[] flush_tlb_mm_range+0x28/0x350 | |CPU: 1 PID: 2130 Comm: tar Tainted: G W 4.8.2-rt2+ #747 |Call Trace: | [] dump_stack+0x86/0xca | [] ___might_sleep+0x14b/0x240 | [] rt_spin_lock+0x24/0x60 | [] get_page_from_freelist+0x83a/0x11b0 | [] __alloc_pages_nodemask+0x15b/0x1190 | [] alloc_pages_current+0xa1/0x1f0 | [] new_slab+0x3e5/0x690 | [] ___slab_alloc+0x495/0x660 | [] __slab_alloc.isra.79+0x71/0xc0 | [] __kmalloc_node+0xe7/0x240 | [] alloc_cpumask_var_node+0x20/0x50 | [] alloc_cpumask_var+0xe/0x10 | [] native_send_call_func_ipi+0x21/0x130 | [] smp_call_function_many+0x22f/0x370 | [] native_flush_tlb_others+0x1a4/0x3a0 | [] flush_tlb_mm_range+0x7b/0x350 | [] tlb_flush_mmu_tlbonly+0x62/0xd0 | [] tlb_finish_mmu+0x14/0x50 | [] unmap_region+0xe4/0x110 | [] do_munmap+0x293/0x470 | [] SyS_brk+0x13c/0x190 | [] do_fast_syscall_32+0xb2/0x2f0 | [] entry_SYSENTER_compat+0x51/0x60 which forbid allocations at run-time. Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig | 2 +- lib/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -938,7 +938,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT config MAXSMP bool "Enable Maximum number of SMP Processors and NUMA Nodes" depends on X86_64 && SMP && DEBUG_KERNEL - select CPUMASK_OFFSTACK + select CPUMASK_OFFSTACK if !PREEMPT_RT_FULL ---help--- Enable maximum number of CPUS and NUMA Nodes for this architecture. If unsure, say N. --- a/lib/Kconfig +++ b/lib/Kconfig @@ -441,6 +441,7 @@ config CHECK_SIGNATURE config CPUMASK_OFFSTACK bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS + depends on !PREEMPT_RT_FULL help Use dynamic allocation for cpumask_var_t, instead of putting them on the stack. This is a bit more expensive, but avoids