Re: [PATCH 2/2] cpuhotplug: make get_online_cpus() scalability byusing percpu counter

From: Oleg Nesterov
Date: Mon Apr 12 2010 - 14:20:14 EST


On 04/12, Lai Jiangshan wrote:
>
> Oleg Nesterov wrote:
> >
> > But, I must admit, I'd like to avoid adding the new member to task_struct.
> >
> > What do you think about the code below?
> >
> > I didn't even try to compile it, just to explain what I mean.
> >
> > In short: we have the per-cpu fast counters, plus the slow counter
> > which is only used when cpu_hotplug_begin() is in progress.
>
> get_online_cpus() in your code is still read-preference.

Yes,

> I wish we quit this ability of get_online_cpus().

Heh. Since I never read the changelogs, I didn't even notice this was
one of the goals of your patch. I thought this is just the side-effect.

Yes, if we want to block the new readers, I don't see how it is possible
to avoid the counter in task_struct.

I can't judge whether this new member worth the trouble. Once again, I am
not arguing, just I don't know. And I think your patch is correct (apart
from pure theoretical race with cpu_hotplug_done afaics).

Oleg.

--
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/