Re: [STACK] >3k call path in ide

From: Rusty Russell
Date: Thu Oct 14 2004 - 21:00:15 EST


On Fri, 2004-06-11 at 09:10, Andrew Morton wrote:
> Jörn Engel <joern@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > read_page_state doesn't exist in 2.6.7-rc3 or 2.6.6-mm5. How is it
> > defined?
>
> It was in 2.6.7-rc3-mm1.
>
>
>
> struct page_state is large (148 bytes) and we put them on the stack in awkward
> code paths (page reclaim...)
>
> So implement a simple read_page_state() which can be used to pluck out a
> single member from the all-cpus page_state accumulators.
>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
...
> +unsigned long __read_page_state(unsigned offset)
> +{
> + unsigned long ret = 0;
> + int cpu;
> +
> + for (cpu = 0; cpu < NR_CPUS; cpu++) {
> + unsigned long in;
> +
> + if (!cpu_possible(cpu))
> + continue;

for_each_cpu(cpu) here perhaps?

Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

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