lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+CK2bCncCgDFe=sUA=2WQLSDB7N69Gpv2upHJ5xJOA-Jb-Grw@mail.gmail.com>
Date: Sat, 25 Jan 2025 11:20:01 -0500
From: Pasha Tatashin <pasha.tatashin@...een.com>
To: Michal Clapinski <mclapinski@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Nitin Gupta <nigupta@...dia.com>, 
	Pasha Tatashin <tatashin@...gle.com>, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mm/compaction: expose a new param for proactive compaction

Subject should be something like:

mm/compaction: Make proactive compaction high watermark configurable via sysctl

On Fri, Jan 24, 2025 at 1:21 PM Michal Clapinski <mclapinski@...gle.com> wrote:
>
> Expose the diff between low and high watermark as a sysctl var.

Please expand, for example:

Currently, the difference between the low and high watermarks for
proactive compaction is hardcoded to 10. This hardcoded difference is
too large for free page reporting to work correctly.

Add a new sysctl, `compaction_proactiveness_leeway`, to control the
difference between the low and high watermarks.

Pasha

>
> Signed-off-by: Michal Clapinski <mclapinski@...gle.com>
> ---
>  mm/compaction.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 29524242a16ef..fd546b797e544 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1921,6 +1921,7 @@ static int sysctl_compact_unevictable_allowed __read_mostly = CONFIG_COMPACT_UNE
>   * background. It takes values in the range [0, 100].
>   */
>  static unsigned int __read_mostly sysctl_compaction_proactiveness = 20;
> +static unsigned int __read_mostly sysctl_compaction_proactiveness_leeway = 10;
>  static int sysctl_extfrag_threshold = 500;
>  static int __read_mostly sysctl_compact_memory;
>
> @@ -2254,7 +2255,7 @@ static unsigned int fragmentation_score_wmark(bool low)
>          * close to 100 (maximum).
>          */
>         wmark_low = 100U - sysctl_compaction_proactiveness;
> -       return low ? wmark_low : min(wmark_low + 10, 100U);
> +       return low ? wmark_low : min(wmark_low + sysctl_compaction_proactiveness_leeway, 100U);
>  }
>
>  static bool should_proactive_compact_node(pg_data_t *pgdat)
> @@ -3314,6 +3315,15 @@ static struct ctl_table vm_compaction[] = {
>                 .extra1         = SYSCTL_ZERO,
>                 .extra2         = SYSCTL_ONE_HUNDRED,
>         },
> +       {
> +               .procname       = "compaction_proactiveness_leeway",
> +               .data           = &sysctl_compaction_proactiveness_leeway,
> +               .maxlen         = sizeof(sysctl_compaction_proactiveness_leeway),
> +               .mode           = 0644,
> +               .proc_handler   = compaction_proactiveness_sysctl_handler,
> +               .extra1         = SYSCTL_ZERO,
> +               .extra2         = SYSCTL_ONE_HUNDRED,
> +       },
>         {
>                 .procname       = "extfrag_threshold",
>                 .data           = &sysctl_extfrag_threshold,
> --
> 2.48.1.262.g85cc9f2d1e-goog
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ