]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mshv: Handle NEED_RESCHED_LAZY before transferring to guest
authorSean Christopherson <seanjc@google.com>
Thu, 28 Aug 2025 00:01:50 +0000 (17:01 -0700)
committerWei Liu <wei.liu@kernel.org>
Tue, 30 Sep 2025 22:50:18 +0000 (22:50 +0000)
commit0ebac01a00be972020c002a7fe0bb6b6fca8410f
tree0b5ca815a28601398080ebb63b66a33b0a7397e9
parent7ad8c34f2435137e2a0dfd0a5dd000e219c642ce
mshv: Handle NEED_RESCHED_LAZY before transferring to guest

Check for NEED_RESCHED_LAZY, not just NEED_RESCHED, prior to transferring
control to a guest.  Failure to check for lazy resched can unnecessarily
delay rescheduling until the next tick when using a lazy preemption model.

Note, ideally both the checking and processing of TIF bits would be handled
in common code, to avoid having to keep three separate paths synchronized,
but defer such cleanups to the future to keep the fix as standalone as
possible.

Cc: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Cc: Mukesh R <mrathor@linux.microsoft.com>
Fixes: 621191d709b1 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/mshv_common.c
drivers/hv/mshv_root_main.c