[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <292e70ed-aae5-4f52-8f85-80cba7ff301d@intel.com>
Date: Thu, 10 Jul 2025 16:00:46 +0800
From: "Chen, Yu C" <yu.c.chen@...el.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
CC: kernel test robot <oliver.sang@...el.com>, Ingo Molnar <mingo@...nel.org>,
<oe-lkp@...ts.linux.dev>, <lkp@...el.com>, <linux-kernel@...r.kernel.org>,
<x86@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Dietmar Eggemann
<dietmar.eggemann@....com>, Juri Lelli <juri.lelli@...hat.com>, "Linus
Torvalds" <torvalds@...ux-foundation.org>, Mel Gorman <mgorman@...e.de>,
Shrikanth Hegde <sshegde@...ux.ibm.com>, Steven Rostedt
<rostedt@...dmis.org>, Valentin Schneider <vschneid@...hat.com>, "Vincent
Guittot" <vincent.guittot@...aro.org>, <aubrey.li@...ux.intel.com>
Subject: Re: [tip:sched/core] [sched/smp] 06ddd17521:
BUG:using_smp_processor_id()in_preemptible
Hi Sebastian,
On 7/10/2025 2:25 PM, Sebastian Andrzej Siewior wrote:
> On 2025-07-10 11:18:29 [+0800], Chen, Yu C wrote:
>>> [ 25.235357][ T1] dump_stack_lvl (lib/dump_stack.c:123 (discriminator 1))
>>> [ 25.235357][ T1] check_preemption_disabled (arch/x86/include/asm/preempt.h:85 lib/smp_processor_id.c:53)
>>> [ 25.235357][ T1] __kvm_is_vmx_supported (arch/x86/include/asm/cpuid/api.h:74 arch/x86/include/asm/cpuid/api.h:113 arch/x86/kvm/vmx/vmx.c:2789)
>>> [ 25.235357][ T1] vmx_init (arch/x86/kvm/vmx/vmx.c:2808 arch/x86/kvm/vmx/vmx.c:8653)
>>> [ 25.235357][ T1] vt_init (arch/x86/kvm/vmx/main.c:1072)
> …
>> I took a glance at the warning, before this patch,
>> is_percpu_thread() always return true when CONFIG_SMP is not set.
>> After this patch,
>> is_percpu_thread() checks the current task's CPU affinity.
>> So debug_smp_processor_id() -> check_preemption_disabled() ->
>> is_percpu_thread() might not always return true anymore, which caused
>> the warning.
>>
>> Actually the issue is in __kvm_is_vmx_supported(), should
>> we use something like this below:
>
> No, it should not. If you look closely you will see that the call chains
> is
> vmx_init() -> kvm_is_vmx_supported() -> __kvm_is_vmx_supported()
>
> There is a migrate_disable() around __kvm_is_vmx_supported(). So why
> does this warning trigger then?
>
migrate_disable() disables the task migration between CPUs by restricting
the task's affinity, but it does not disable the preemption on single
CPUs IMO. The scope of guard(preempt)() in migrate_disable() is just
within the migrate_disable(). debug_smp_processor_id() warns when the
preemption is enabled.
Thanks,
Chenyu
Powered by blists - more mailing lists