archive mirror
 help / color / mirror / Atom feed
From: Charan Teja Kalla <>
To: Mel Gorman <>,,,,,,,,,,,,,,,,,
Subject: Re: [PATCH] mm: compaction: improve /proc trigger for full node memory compaction
Date: Mon, 3 May 2021 17:07:23 +0530	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>


A gentle ping to get your review comments. They will be of great help to me.

Explained below that though the compact_memory node is intended for
debug purpose, it got other applications too. This patch just aims to
improve that by taking help of proactive compaction.

Also triggering proactive compaction for every 500msec is not always
required (say that I mostly need higher order pages in the systems only
at while launching a set of apps, then the work done by the proactive
compaction for every 500msec is not going to be useful in other times).
Thus users will disable the proactive
compaction(sysctl.compaction_proactiveness = 0) and when required can do
the out-of-band compaction using the provided interface.

If a separate /proc node shouldn't be present just for this, then the
other solution I am thinking of is:
1) Trigger the proactive compaction on every write to
sysctl.compaction_proactiveness, instead of waiting for 500msec wakeup,
thus users can immediately turn on/off the proactive compaction when


On 4/28/2021 9:02 PM, Charan Teja Kalla wrote:
> Thanks Mel for your comments!!
> On 4/27/2021 1:39 PM, Mel Gorman wrote:
>>> The existing /proc/sys/vm/compact_memory interface do the full node
>>> compaction when user writes an arbitrary value to it and is targeted for
>>> the usecases like an app launcher prepares the system before the target
>>> application runs.
>> The intent behind compact_memory was a debugging interface to tell
>> the difference between an application failing to allocate a huge page
>> prematurely and the inability of compaction to find a free page.
> Thanks for clarifying this.
>>> This patch adds a new /proc interface,
>>> /proc/sys/vm/proactive_compact_memory, and on write of an arbitrary
>>> value triggers the full node compaction but can be stopped in the middle
>>> if sufficient higher order(COMPACTION_HPAGE_ORDER) pages available in
>>> the system. The availability of pages that a user looking for can be
>>> given as input through /proc/sys/vm/compaction_proactiveness.
>>> [1]
>>> Signed-off-by: Charan Teja Reddy <>
>> Hence, while I do not object to the patch as-such, I'm wary of the trend
>> towards improving explicit out-of-band compaction via proc interfaces. I
> I think people relying on this /proc/../compact_memory for reasons of on
> demand compaction effects the performance and the kcompactd returns when
>  even a single page of the order we are looking for is available. Say
> that If an app launching completion is relied on the memory
> fragmentation, meaning that lesser the system fragmented, lesser it
> needs to spend time on allocation as it gets more higher order pages.
> With the current compaction methods we may get just one higher order
> page at a time (as compaction stops run after that) thus can effect its
> launch completion time. The compact_memory node can help in these
> situation where the system administrator can defragment system whenever
> is required by writing to the compact_node. This is just a theoretical
> example.
> Although it is intended for debugging interface, it got a lot of other
> applications too.
> This patch aims to improve this interface by taking help from tunables
> provided by the proactive compaction.
>> would have preferred if the focus was on reducing the cost of compaction
>> so that direct allocation requests succeed quickly or improving background
>> compaction via kcompactd when there has been recent failures.

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum, a Linux Foundation Collaborative Project

      reply	other threads:[~2021-05-03 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 13:37 Charan Teja Reddy
2021-04-27  8:09 ` Mel Gorman
2021-04-28 15:32   ` Charan Teja Kalla
2021-05-03 11:37     ` Charan Teja Kalla [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] mm: compaction: improve /proc trigger for full node memory compaction' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).