|
|
Subscribe / Log in / New account

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

From:  Andrew Morton <akpm-AT-linux-foundation.org>
To:  Mel Gorman <mel-AT-csn.ul.ie>
Subject:  Re: [PATCH 08/11] Add /proc trigger for memory compaction
Date:  Wed, 24 Mar 2010 13:33:51 -0700
Cc:  Andrea Arcangeli <aarcange-AT-redhat.com>, Christoph Lameter <cl-AT-linux-foundation.org>, Adam Litke <agl-AT-us.ibm.com>, Avi Kivity <avi-AT-redhat.com>, David Rientjes <rientjes-AT-google.com>, Minchan Kim <minchan.kim-AT-gmail.com>, KAMEZAWA Hiroyuki <kamezawa.hiroyu-AT-jp.fujitsu.com>, KOSAKI Motohiro <kosaki.motohiro-AT-jp.fujitsu.com>, Rik van Riel <riel-AT-redhat.com>, linux-kernel-AT-vger.kernel.org, linux-mm-AT-kvack.org

On Tue, 23 Mar 2010 12:25:43 +0000
Mel Gorman <mel@csn.ul.ie> 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>




to post comments

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

Posted Apr 3, 2010 23:28 UTC (Sat) by HelloWorld (guest, #56129) [Link]

Ugh, that's ugly. It should be return write ? compact_nodes : 0;


Copyright © 2010, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds