Re: [PATCH] SMP support for drain local pages.

From: Pavel Machek
Date: Thu May 27 2004 - 14:33:51 EST


Hi!

> This patch adds SMP support for drain_local_pages, so that suspend
> implementations can drain pcp structures on all CPUs and thus
> accurately
> determine which pages are free.

Why do you need it, btw?

1st it might be easier to just on_each_cpu(drain_local_pages)
in suspend2

2nd all but one cpus are stopped, right? That mrans that their local pages can't
mess up suspnd's accounting => no need to drain them.
Pavel

2.6.6-current-bk/mm/page_alloc.c
> smp-drain-local-pages/mm/page_alloc.c
> --- 2.6.6-current-bk/mm/page_alloc.c 2004-05-26 19:47:15.000000000
> +1000
> +++ smp-drain-local-pages/mm/page_alloc.c 2004-05-26
> 19:56:19.000000000 +1000
> @@ -459,6 +459,24 @@
> __drain_pages(smp_processor_id());
> local_irq_restore(flags);
> }
> +
> +#ifdef CONFIG_SMP
> +static void __smp_drain_local_pages(void * data)
> +{
> + drain_local_pages();
> +}
> +
> +void smp_drain_local_pages(void)
> +{
> + smp_call_function(__smp_drain_local_pages, NULL, 0, 1);
> + drain_local_pages();
> +}
> +#else
> +void smp_drain_local_pages(void)
> +{
> + drain_local_pages();
> +}
> +#endif
> #endif /* CONFIG_PM */
>
> static void zone_statistics(struct zonelist *zonelist, struct zone
> *z)
>
>
>
> -
> 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/

--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms

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