[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210517140312.226734512@linuxfoundation.org>
Date: Mon, 17 May 2021 16:02:16 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Ben Segall <bsegall@...gle.com>,
Venkatesh Srinivas <venkateshs@...omium.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Jim Mattson <jmattson@...gle.com>
Subject: [PATCH 5.10 211/289] kvm: exit halt polling on need_resched() as well
From: Benjamin Segall <bsegall@...gle.com>
commit 262de4102c7bb8e59f26a967a8ffe8cce85cc537 upstream.
single_task_running() is usually more general than need_resched()
but CFS_BANDWIDTH throttling will use resched_task() when there
is just one task to get the task to block. This was causing
long-need_resched warnings and was likely allowing VMs to
overrun their quota when halt polling.
Signed-off-by: Ben Segall <bsegall@...gle.com>
Signed-off-by: Venkatesh Srinivas <venkateshs@...omium.org>
Message-Id: <20210429162233.116849-1-venkateshs@...omium.org>
Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
Cc: stable@...r.kernel.org
Reviewed-by: Jim Mattson <jmattson@...gle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
virt/kvm/kvm_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2797,7 +2797,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcp
goto out;
}
poll_end = cur = ktime_get();
- } while (single_task_running() && ktime_before(cur, stop));
+ } while (single_task_running() && !need_resched() &&
+ ktime_before(cur, stop));
}
prepare_to_rcuwait(&vcpu->wait);
Powered by blists - more mailing lists