We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e86350f commit adde871Copy full SHA for adde871
arch/powerpc/platforms/pseries/lpar.c
@@ -636,8 +636,16 @@ static const struct proc_ops vcpudispatch_stats_freq_proc_ops = {
636
637
static int __init vcpudispatch_stats_procfs_init(void)
638
{
639
- if (!lppaca_shared_proc(get_lppaca()))
+ /*
640
+ * Avoid smp_processor_id while preemptible. All CPUs should have
641
+ * the same value for lppaca_shared_proc.
642
+ */
643
+ preempt_disable();
644
+ if (!lppaca_shared_proc(get_lppaca())) {
645
+ preempt_enable();
646
return 0;
647
+ }
648
649
650
if (!proc_create("powerpc/vcpudispatch_stats", 0600, NULL,
651
&vcpudispatch_stats_proc_ops))
0 commit comments