[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] arm: use a per-VCPU stack



At 16:49 +0000 on 15 Feb (1329324592), Ian Campbell wrote:
> +struct pcpu_info {
> +    unsigned int processor_id;
> +    struct vcpu *current_vcpu;
> +};
> +
> +DECLARE_PER_CPU(struct pcpu_info, pcpu_info);

> +static inline struct pcpu_info *get_pcpu_info(void)
> +{
> +    return &this_cpu(pcpu_info);
> +}
> +

I don't think it's worth declaring a struct and accessors for this; we
should just have current_vcpu as an ordinary per-cpu variable.

Storing the CPU ID in the per-pcpu area only happens to work because
per-cpu areas are a noop right now.  I have a patch that re-enables them
properly but for that we'll need a proper way of getting the CPU id.  In
the meantime I think it would be less confusing just to hard-code it as
zero than to do this. :)

We could use the physical CPU ID register; I don't know whether it would
be faster to stash the ID on the (per-vcpu) stack and update it during
context switch.

Aside from that, this patch looks OK to me.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.