Re: [PATCH 3/3] Xen physical cpus interface (V2)

From: Konrad Rzeszutek Wilk
Date: Fri May 11 2012 - 15:37:45 EST


> >> +struct pcpu {
> >> + struct list_head list;
> >> + struct device dev;
> >> + uint32_t cpu_id;
> >> + uint32_t flags;
> >> +};
> >> +
> >> +static struct bus_type xen_pcpu_subsys = {
> >> + .name = "xen_cpu",
> >> + .dev_name = "xen_cpu",
> >> +};
> >> +
> >> +static DEFINE_MUTEX(xen_pcpu_lock);
> >> +
> >> +static LIST_HEAD(xen_pcpus);
> >
> > So what about the recommendation to get rid of that and
> > instead do
> >
> > struct pcpu *xen_cpu;
>
> I'm not quite clear your meaning here, do you mean 'LIST_HEAD(xen_pcpus)' instead of 'struct pcpu *xen_cpu'?

No. Just use the embedded 'struct list_head' inside of 'struct pcpu'
as your iterator.

And your first 'struct pcpu' won't ever be deleted (as it is for
CPU0), so you can iterate from that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/