public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Marko Kohtala <marko.kohtala-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] KVM_SET_MEMORY_REGION hang in linux 2.6.23.y
Date: Wed, 21 Nov 2007 08:56:28 +0200	[thread overview]
Message-ID: <4743D69C.7000808@qumranet.com> (raw)
In-Reply-To: <20071120223802.7afe5d00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Marko Kohtala wrote:
> Wait for right amount of tlb flushes. Completed can be larger than
> needed and therefore the loop waiting them to match never ends.
>
> Signed-off-by: Marko Kohtala <marko.kohtala-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> ---
>
> This solves kernel lockup in KVM_SET_MEMORY_REGION ioctl with Linux
> 2.6.23.8 and before at kvm-52 start. Not needed in 2.6.24.
>
> diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
> index cd05579..b148aff 100644
> --- a/drivers/kvm/kvm_main.c
> +++ b/drivers/kvm/kvm_main.c
> @@ -279,7 +279,8 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
>  	 * to complete.
>  	 */
>  	for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus))
> -		smp_call_function_single(cpu, ack_flush, &completed, 1, 0);
> +		if (cpu_isset(cpu, cpus))
> +			smp_call_function_single(cpu, ack_flush, &completed, 1, 0);
>   

Can you explain how this makes a difference?  Aren't first_cpu() and 
next_cpu() designed to iterate over all cpus which have cpu_isset(cpus)?

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2007-11-21  6:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20 20:38 [PATCH] KVM_SET_MEMORY_REGION hang in linux 2.6.23.y Marko Kohtala
     [not found] ` <20071120223802.7afe5d00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-11-21  6:56   ` Avi Kivity [this message]
     [not found]     ` <4743D69C.7000808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-21  8:04       ` Marko Kohtala
     [not found]         ` <9cfa10eb0711210004o61ef22dbp7e411e2327810aab-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-11-21  8:12           ` Avi Kivity

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=4743D69C.7000808@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=marko.kohtala-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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