From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Venkatesh Srinivas <venkateshs@chromium.org>,
kvm@vger.kernel.org, jmattson@google.com, pbonzini@redhat.com,
dmatlack@google.com
Cc: Benjamin Segall <bsegall@google.com>
Subject: Re: [PATCH] kvm: exit halt polling on need_resched() as well
Date: Fri, 30 Apr 2021 19:43:40 +0200 [thread overview]
Message-ID: <ea54b776-c15a-e718-d7c9-ae8df7f24de3@de.ibm.com> (raw)
In-Reply-To: <20210429162233.116849-1-venkateshs@chromium.org>
On 29.04.21 18:22, Venkatesh Srinivas wrote:
> From: Benjamin Segall <bsegall@google.com>
>
> 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@google.com>
> Signed-off-by: Venkatesh Srinivas <venkateshs@chromium.org>
would that qualify for stable?
> ---
> virt/kvm/kvm_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 2799c6660cce..b9f12da6af0e 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -2973,7 +2973,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
> 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);
>
next prev parent reply other threads:[~2021-04-30 17:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 16:22 [PATCH] kvm: exit halt polling on need_resched() as well Venkatesh Srinivas
2021-04-29 16:39 ` Jim Mattson
2021-04-30 15:48 ` David Matlack
2021-04-30 17:43 ` Christian Borntraeger [this message]
2021-05-03 14:52 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea54b776-c15a-e718-d7c9-ae8df7f24de3@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=bsegall@google.com \
--cc=dmatlack@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=venkateshs@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).