Re: [PATCH 08/11] Add /proc trigger for memory compaction

From: Andrew Morton
Date: Wed Mar 24 2010 - 16:35:14 EST


On Tue, 23 Mar 2010 12:25:43 +0000
Mel Gorman <mel@xxxxxxxxx> wrote:

> This patch adds a proc file /proc/sys/vm/compact_memory. When an arbitrary
> value is written to the file, all zones are compacted. The expected user
> of such a trigger is a job scheduler that prepares the system before the
> target application runs.
>
>
> ...
>
> +/* This is the entry point for compacting all nodes via /proc/sys/vm */
> +int sysctl_compaction_handler(struct ctl_table *table, int write,
> + void __user *buffer, size_t *length, loff_t *ppos)
> +{
> + if (write)
> + return compact_nodes();
> +
> + return 0;
> +}

Neato. When I saw the overall description I was afraid that this stuff
would be fiddling with kernel threads.

The underlying compaction code can at times cause rather large amounts
of memory to be put onto private lists, so it's lost to the rest of the
kernel. What happens if 10000 processes simultaneously write to this
thing? It's root-only so I guess the answer is "root becomes unemployed".


I fear that the overall effect of this feature is that people will come
up with ghastly hacks which keep on poking this tunable as a workaround
for some VM shortcoming. This will lead to more shortcomings, and
longer-lived ones.


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