From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH RFC v2 4/4] Use macro to iterate over vcpus.
Date: Tue, 26 May 2009 11:18:11 +0300 [thread overview]
Message-ID: <4A1BA5C3.3000204@redhat.com> (raw)
In-Reply-To: <1243266636-16914-5-git-send-email-gleb@redhat.com>
Gleb Natapov wrote:
> void kvm_arch_sync_events(struct kvm *kvm)
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 0934df3..34634e0 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -170,6 +170,17 @@ struct kvm {
> #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
> #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
>
> +static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
> +{
> + smp_rmb();
> + return kvm->vcpus[i];
> +}
>
Whitespace.
> +
> +#define kvm_for_each_vcpu(idx, vcpup, kvm) \
> + for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \
> + idx < atomic_read(&kvm->online_vcpus) && vcpup; \
> + vcpup = kvm_get_vcpu(kvm, ++idx))
> +
>
This will stop when reaching the first empty vcpu slot, while current
code skips over empty slots. Please preserve existing behaviour.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-05-26 8:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 15:50 [PATCH RFC v2 0/4] decouple vcpu index from apic id Gleb Natapov
2009-05-25 15:50 ` [PATCH RFC v2 1/4] Introduce kvm_vcpu_is_bsp() function Gleb Natapov
2009-05-25 20:46 ` Marcelo Tosatti
2009-05-26 6:12 ` Gleb Natapov
2009-05-25 15:50 ` [PATCH RFC v2 2/4] Use pointer to vcpu instead of vcpu_id in timer code Gleb Natapov
2009-05-26 8:30 ` Avi Kivity
2009-05-26 8:52 ` Gleb Natapov
2009-05-25 15:50 ` [PATCH RFC v2 3/4] Break dependency between vcpu index in vcpus array and vcpu_id Gleb Natapov
2009-05-26 8:34 ` Avi Kivity
2009-05-26 8:55 ` Gleb Natapov
2009-05-26 8:57 ` Avi Kivity
2009-05-25 15:50 ` [PATCH RFC v2 4/4] Use macro to iterate over vcpus Gleb Natapov
2009-05-26 8:18 ` Avi Kivity [this message]
2009-05-26 8:37 ` Gleb Natapov
2009-05-26 8:56 ` 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=4A1BA5C3.3000204@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.