All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Li Wang" <li.wang@linux.dev>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] hugepages: ensure CONFIG_COMPACTION is defined
Date: Fri, 17 Jul 2026 07:45:37 +0000	[thread overview]
Message-ID: <6a59dda2.ff5210e6.1a2a26.c868@mx.google.com> (raw)
In-Reply-To: <alnbk-wNqcenHl2S@linux.dev>

Hi Li,

> Writing 1 to /proc/sys/vm/compact_memory only triggers proactive
> memory compaction. It's a best-effort hint that makes a hugepage
> reservation more likely to succeed by defragmenting memory
> beforehand, but the reservation itself does not depend on it.
> 
> The kernel can (and often will) still satisfy the request without
> any explicit compaction step. So treating a missing compact_memory
> (i.e. CONFIG_COMPACTION=n) as a hard TCONF is too strict: it skips
> tests that could otherwise run perfectly fine.
> 
> Given that, I don't think we should tst_brk(TCONF) here at all.
> My suggetion is not to use SAFE_* macros:
> 
> --- a/lib/tst_hugepage.c
> +++ b/lib/tst_hugepage.c
> @@ -47,7 +47,7 @@ unsigned long tst_reserve_hugepages(struct tst_hugepage *hp)
>         }
>  
>         SAFE_FILE_PRINTF(PATH_VM_DROP_CACHES, "3");
> -       SAFE_FILE_PRINTF(PATH_VM_COMPACT_MEMORY, "1");
> +       FILE_PRINTF(PATH_VM_COMPACT_MEMORY, "1");
>         if (hp->policy == TST_NEEDS) {
>                 tst_hugepages += SAFE_READ_MEMINFO("HugePages_Total:");
>                 goto set_hugepages;
> 
> 
> -- 
> Regards,
> Li Wang

thanks for the patch, indeed I was not sure about the approach and I
think this might work. I will wait for other people to send a final
patch fixing this issue. it sounds resonable to me to follow your
approach.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-07-17  7:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  6:29 [LTP] [PATCH] hugepages: ensure CONFIG_COMPACTION is defined Andrea Cervesato
2026-07-17  6:49 ` Andrea Cervesato via ltp
2026-07-17  7:36 ` Li Wang
2026-07-17  7:45   ` Andrea Cervesato via ltp [this message]
2026-07-17  7:48   ` Cyril Hrubis
2026-07-17  9:34     ` Petr Vorel
2026-07-17  9:32 ` Petr Vorel

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=6a59dda2.ff5210e6.1a2a26.c868@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=li.wang@linux.dev \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.