Thread (10 messages) 10 messages, 4 authors, 2021-05-29

RE: [PATCH V2] mm: compaction: support triggering of proactive compaction by user

From: Nitin Gupta <hidden>
Date: 2021-05-25 20:35:44
Also in: linux-fsdevel, lkml

-----Original Message-----
From: charante=codeaurora.org@mg.codeaurora.org
[off-list ref] On Behalf Of Charan Teja
Reddy
Sent: Tuesday, May 18, 2021 6:38 AM
To: akpm@linux-foundation.org; mcgrof@kernel.org;
keescook@chromium.org; yzaikin@google.com; vbabka@suse.cz; Nitin
Gupta [off-list ref]; bhe@redhat.com;
mateusznosek0@gmail.com; sh_def@163.com; iamjoonsoo.kim@lge.com;
vinmenon@codeaurora.org
Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org; linux-
fsdevel@vger.kernel.org; Charan Teja Reddy [off-list ref]
Subject: [PATCH V2] mm: compaction: support triggering of proactive
compaction by user

External email: Use caution opening links or attachments


The proactive compaction[1] gets triggered for every 500msec and run
compaction on the node for COMPACTION_HPAGE_ORDER (usually order-9)
pages based on the value set to sysctl.compaction_proactiveness.
Triggering the compaction for every 500msec in search of
COMPACTION_HPAGE_ORDER pages is not needed for all applications,
especially on the embedded system usecases which may have few MB's of
RAM. Enabling the proactive compaction in its state will endup in running
almost always on such systems.
You can disable proactive compaction by setting sysctl.compaction_proactiveness to 0.

Other side, proactive compaction can still be very much useful for getting a
set of higher order pages in some controllable manner(controlled by using
the sysctl.compaction_proactiveness). Thus on systems where enabling the
proactive compaction always may proove not required, can trigger the same
from user space on write to its sysctl interface. As an example, say app
launcher decide to launch the memory heavy application which can be
launched fast if it gets more higher order pages thus launcher can prepare
the system in advance by triggering the proactive compaction from
userspace.
You can always do: echo 1 > /proc/sys/vm/compact_memory
On a small system, this should not take much time.

Hijacking proactive compaction for one-off compaction (say, before a large app launch)
does not sound right to me.

Thanks,
Nitin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help