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 a21d1be commit ca3f969Copy full SHA for ca3f969
arch/powerpc/include/asm/paravirt.h
@@ -10,6 +10,9 @@
10
#endif
11
12
#ifdef CONFIG_PPC_SPLPAR
13
+#include <asm/kvm_guest.h>
14
+#include <asm/cputhreads.h>
15
+
16
DECLARE_STATIC_KEY_FALSE(shared_processor);
17
18
static inline bool is_shared_processor(void)
@@ -74,6 +77,21 @@ static inline bool vcpu_is_preempted(int cpu)
74
77
{
75
78
if (!is_shared_processor())
76
79
return false;
80
81
+#ifdef CONFIG_PPC_SPLPAR
82
+ if (!is_kvm_guest()) {
83
+ int first_cpu = cpu_first_thread_sibling(smp_processor_id());
84
85
+ /*
86
+ * Preemption can only happen at core granularity. This CPU
87
+ * is not preempted if one of the CPU of this core is not
88
+ * preempted.
89
+ */
90
+ if (cpu_first_thread_sibling(cpu) == first_cpu)
91
+ return false;
92
+ }
93
+#endif
94
95
if (yield_count_of(cpu) & 1)
96
return true;
97
0 commit comments