From: Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Laurent Vivier <Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] kvm uses smp_call_function_mask() inkvm_flush_remote_tlbs()
Date: Mon, 22 Oct 2007 16:57:36 +0200 [thread overview]
Message-ID: <471CBA60.2030402@qumranet.com> (raw)
In-Reply-To: <11930635871488-git-send-email-Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
Laurent Vivier wrote:
>
> This patches can be applied only on kvm-updates-2.6.24 and
> kvm-updates-2.6.25
> as it needs smp_call_function_mask().
>
> In kvm_flush_remote_tlbs(), it replaces a loop using
> smp_call_function_single()
> by a single call to smp_call_function_mask().
>
Would you be kind enough to copy the implementation of
smp_call_function_mask
into external_module_compat.h so older kernel's will still work after
this commited.
Thanks, Dor.
>
> Signed-off-by: Laurent Vivier <Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
> ---
> drivers/kvm/kvm_main.c | 26 +++-----------------------
> 1 files changed, 3 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
> index bf6a86c..6f7b31e 100644
> --- a/drivers/kvm/kvm_main.c
> +++ b/drivers/kvm/kvm_main.c
> @@ -200,21 +200,15 @@ void vcpu_put(struct kvm_vcpu *vcpu)
>
> static void ack_flush(void *_completed)
> {
> - atomic_t *completed = _completed;
> -
> - atomic_inc(completed);
> }
>
> void kvm_flush_remote_tlbs(struct kvm *kvm)
> {
> - int i, cpu, needed;
> + int i, cpu;
> cpumask_t cpus;
> struct kvm_vcpu *vcpu;
> - atomic_t completed;
>
> - atomic_set(&completed, 0);
> cpus_clear(cpus);
> - needed = 0;
> for (i = 0; i < KVM_MAX_VCPUS; ++i) {
> vcpu = kvm->vcpus[i];
> if (!vcpu)
> @@ -223,23 +217,9 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
> continue;
> cpu = vcpu->cpu;
> if (cpu != -1 && cpu != raw_smp_processor_id())
> - if (!cpu_isset(cpu, cpus)) {
> - cpu_set(cpu, cpus);
> - ++needed;
> - }
> - }
> -
> - /*
> - * We really want smp_call_function_mask() here. But that's not
> - * available, so ipi all cpus in parallel and wait for them
> - * 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);
> - while (atomic_read(&completed) != needed) {
> - cpu_relax();
> - barrier();
> + cpu_set(cpu, cpus);
> }
> + smp_call_function_mask(cpus, ack_flush, NULL, 1);
> }
>
> int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
> --
> 1.5.2.4
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-10-22 14:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 14:33 [PATCH] kvm uses smp_call_function_mask() in kvm_flush_remote_tlbs() Laurent Vivier
[not found] ` <11930635871488-git-send-email-Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
2007-10-22 14:57 ` Dor Laor [this message]
[not found] ` <471CBA60.2030402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-22 15:02 ` [PATCH] kvm uses smp_call_function_mask() inkvm_flush_remote_tlbs() Laurent Vivier
[not found] ` <471CBB70.5050109-6ktuUTfB/bM@public.gmane.org>
2007-10-22 15:11 ` Avi Kivity
2007-10-22 15:24 ` [PATCH] kvm uses smp_call_function_mask() in kvm_flush_remote_tlbs() Avi Kivity
2007-10-22 16:24 ` Carsten Otte
[not found] ` <471CCEC8.9060200-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-10-22 17:05 ` Avi Kivity
[not found] ` <471CD876.5020404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-22 18:36 ` Avi Kivity
2007-10-23 11:50 ` Carsten Otte
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=471CBA60.2030402@qumranet.com \
--to=dor.laor-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Laurent.Vivier-6ktuUTfB/bM@public.gmane.org \
--cc=dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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