linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Charan Teja Reddy <charante@codeaurora.org>
Cc: akpm@linux-foundation.org, vbabka@suse.cz, bhe@redhat.com,
	nigupta@nvidia.com, khalid.aziz@oracle.com,
	mateusznosek0@gmail.com, sh_def@163.com, iamjoonsoo.kim@lge.com,
	mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com,
	mhocko@suse.com, rientjes@google.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, vinmenon@codeaurora.org
Subject: Re: [PATCH] mm: compaction: improve /proc trigger for full node memory compaction
Date: Tue, 27 Apr 2021 09:09:22 +0100	[thread overview]
Message-ID: <20210427080921.GG4239@techsingularity.net> (raw)
In-Reply-To: <1619098678-8501-1-git-send-email-charante@codeaurora.org>

On Thu, Apr 22, 2021 at 07:07:58PM +0530, Charan Teja Reddy 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.

> The downside of it is that even if there are
> sufficient higher order pages left in the system for the targeted
> application to run, full node compaction will still be triggered thus
> wasting few CPU cycles. This problem can be solved if it is known when
> the sufficient higher order pages are available in the system thus full
> node compaction can be stopped in the middle. The proactive
> compaction[1] can give these details about the availability of higher
> order pages in the system(it checks for COMPACTION_HPAGE_ORDER pages,
> which usually be order-9) thus can be used to trigger for full node
> compaction.
> 
> 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]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=facdaa917c4d5a376d09d25865f5a863f906234a
> 
> Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>

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

-- 
Mel Gorman
SUSE Labs

  reply	other threads:[~2021-04-27  8:09 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 [this message]
2021-04-28 15:32   ` Charan Teja Kalla
2021-05-03 11:37     ` Charan Teja Kalla

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20210427080921.GG4239@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=charante@codeaurora.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=keescook@chromium.org \
    --cc=khalid.aziz@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mateusznosek0@gmail.com \
    --cc=mcgrof@kernel.org \
    --cc=mhocko@suse.com \
    --cc=nigupta@nvidia.com \
    --cc=rientjes@google.com \
    --cc=sh_def@163.com \
    --cc=vbabka@suse.cz \
    --cc=vinmenon@codeaurora.org \
    --cc=yzaikin@google.com \
    --subject='Re: [PATCH] mm: compaction: improve /proc trigger for full node memory compaction' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).