mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
locking/pvqspinlock: Don't wait if vCPU is preempted
If prev node is not in running state or its vCPU is preempted, we can give up our vCPU slices in pv_wait_node() ASAP. Signed-off-by: Pan Xinhui <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Fixed typos in the changelog, removed ugly linebreak from the code. ] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
607904c357
commit
75437bb304
1 file changed
+1
-1
@@ -263,7 +263,7 @@ pv_wait_early(struct pv_node *prev, int loop)
|
||||
if ((loop & PV_PREV_CHECK_MASK) != 0)
|
||||
return false;
|
||||
|
||||
return READ_ONCE(prev->state) != vcpu_running;
|
||||
return READ_ONCE(prev->state) != vcpu_running || vcpu_is_preempted(prev->cpu);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user