lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V2] mm: compaction: support triggering of proactive compaction by user
Date


> -----Original Message-----
> From: charante=codeaurora.org@mg.codeaurora.org
> <charante=codeaurora.org@mg.codeaurora.org> 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 <nigupta@nvidia.com>; 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 <charante@codeaurora.org>
> 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

\
 
 \ /
  Last update: 2021-05-25 22:36    [W:0.113 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site