Re: [PATCH] Prezeroing V8

From: Nish Aravamudan
Date: Thu Mar 17 2005 - 18:02:36 EST


On Thu, 17 Mar 2005 13:43:47 -0800 (PST), Christoph Lameter
<clameter@xxxxxxx> wrote:
> Changelog:
> - Drop clear_pages and the approach to zero pages of higher order
> first
> - Zero a percentage of pages from all orders to avoid fragmentation
>
> Adds management of ZEROED and NOT_ZEROED pages and a background daemon
> called scrubd. /proc/sys/vm/scrubd_load, /proc/sys/vm_scrubd_start and
> /proc/sys/vm_scrubd_stop control the scrub daemon. See Documentation/vm/
> scrubd.txt
>
> In an SMP environment the scrub daemon is typically running on the most
> idle cpu. Thus a single threaded application running
> on one cpu may have the other cpu zeroing pages for it etc. The scrub
> daemon is hardly noticable and usually finishes zeroing quickly since
> most processors are optimized for linear memory filling.
>
> Patch against 2.6.11.3-bk3
>
> Signed-off-by: Christoph Lameter <clameter@xxxxxxx>
>

<snip>

> Index: linux-2.6.11/mm/scrubd.c
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ linux-2.6.11/mm/scrubd.c 2005-03-17 13:12:23.000000000 -0800

<snip>

> +/*
> + * scrub_pgdat() will work across all this node's zones.
> + */
> +static void scrub_pgdat(pg_data_t *pgdat)
> +{
> + int i;
> +
> + if (system_state != SYSTEM_RUNNING)
> + return;
> +
> + while (avenrun[0] >= ((unsigned long)sysctl_scrub_load << FSHIFT))
> + schedule_timeout(30*HZ);

This is a busy-loop, unless you set the state before you call
schedule_timeout(). Additionally, you really want to sleep 30 seconds
at a time? Please use msleep() or msleep_interruptible(), unless you
expect wait-queue events.

Thanks,
Nish
-
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/