Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH] Remove More Unneccessary CPU Notifiers | Date | Sun, 25 Jan 2004 13:23:22 +1100 |
| |
In message <20040124101039.296c34fd.akpm@osdl.org> you write: > Or are you saying that we should just leave the per-cpu accounting in a > non-zero state when its CPU has gone away, and rely upon the stats > gathering code iterating across all cpu_possible cpus?
In general, yes! In general, if you cared about performance you wouldn't be doing such iteration.
> That's a bit lame in the case of __get_page_state() at least. We've had > problems with excess CPU consumption in there at times and it would be good > to be able to change that function to iterate across all online CPUs, not > all possible ones. We can do that if we have a notifier which spills the > numbers from the gone-away CPU into the local CPU's slot.
Well, that's what's happening at the moment if you look at the code:
while (cpu < NR_CPUS) { unsigned long *in, *out, off;
if (!cpu_possible(cpu)) { cpu++; continue; }
Spilling the stats is a fine optimization, sure, but that can come later.
Especially since it need only be done at CPU_DEAD time: the hotplug CPU patch adds a convenient macro for such things. "hotcpu_notifier()" compiles out when !CONFIG_HOTPLUG_CPU.
What's there at the moment really is just wasted code. RUsty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |