From: linuxtestproject.agent@gmail.com
To: Samir Mulani <samir@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] hugemmap: Migrate alloc-instantiate-race test from libhugetlbfs
Date: Fri, 21 Aug 2026 18:39:19 +0000 [thread overview]
Message-ID: <20260821183919.8954-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260821121239.50594-1-samir@linux.ibm.com>
Hi Samir,
On Aug 21, 2026, Samir Mulani wrote:
> hugemmap: Migrate alloc-instantiate-race test from libhugetlbfs
> + SAFE_PTHREAD_CREATE(&thread1, NULL, thread_racer, &ri1);
> + SAFE_PTHREAD_CREATE(&thread2, NULL, thread_racer, &ri2);
> +
> + /* Wake both threads to start the race simultaneously */
> + TST_CHECKPOINT_WAKE2(0, 2);
Medium: Could the MAP_PRIVATE pthread race run in a child process so that
the parent can translate SIGBUS into TFAIL?
The allocation failure under test makes hugetlb_no_page() return
VM_FAULT_SIGBUS. An unhandled SIGBUS in either thread terminates the whole
thread group, after which LTP's check_child_status() reports TBROK instead
of identifying the kernel regression as TFAIL. The MAP_SHARED variant
already translates signal deaths in its child racers.
> + cpu_set_t cpuset;
> + int total_cpus, cpu_idx;
> +
> + CPU_ZERO(&cpuset);
> +
> + total_cpus = get_nprocs_conf();
> +
> + if (sched_getaffinity(0, sizeof(cpu_set_t), &cpuset) == -1)
> + tst_brk(TBROK | TERRNO, "sched_getaffinity() failed");
Medium: Could this use a dynamic mask sized with tst_ncpus_max(),
CPU_ALLOC(), and CPU_ALLOC_SIZE()?
sched_getaffinity() returns EINVAL when the supplied buffer is smaller
than the kernel affinity mask. A kernel supporting more than CPU_SETSIZE
CPUs therefore produces TBROK even when the test has two usable CPUs.
> +#include <pthread.h>
> +#include "tst_test.h"
> +#include "tst_safe_pthread.h"
Medium: Could hugemmap42 be added to the Makefile's existing
CFLAGS += -pthread rule?
The test links on modern glibc because libpthread was merged into libc,
but older supported libc versions need -pthread to resolve the symbols
used by the safe pthread wrappers.
> +/hugetlb/hugemmap/hugemmap42
Low: Could this entry be moved to a leaf
testcases/kernel/mem/hugetlb/hugemmap/.gitignore?
New test binaries should be ignored in their own test directory rather
than in testcases/kernel/mem/.gitignore.
> + .hugepages = {2, TST_NEEDS},
> + .forks_child = 1,
> + .needs_checkpoints = 1,
> + .min_cpus = 2,
> +};
Low: Could the kernel fix for this regression be added as a linux-git
tag so that failures provide the missing-fix hint?
> + * other racing process.
> + */
> [...]
> + .needs_root = 1,
Low: Could the exported description explain that root is needed to
reserve hugepages and mount hugetlbfs?
> + SAFE_CLOSE(fd_race);
> + fd_race = -1;
> [...]
> + if (fd_race >= 0)
> + SAFE_CLOSE(fd_race);
Low: Could the redundant assignment be removed and the cleanup guard use
fd_race != -1, with the same changes for fd_sync?
SAFE_CLOSE() already sets the descriptor to -1, and != -1 is the LTP
descriptor-validity convention.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-08-21 18:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 12:12 [LTP] [PATCH v7] hugemmap: Migrate alloc-instantiate-race test from libhugetlbfs Samir Mulani
2026-08-21 18:39 ` linuxtestproject.agent [this message]
2026-08-31 13:34 ` Cyril Hrubis
2026-09-10 19:13 ` samir
-- strict thread matches above, loose matches on Subject: below --
2026-08-18 14:31 [LTP] [PATCH v6] " Samir Mulani
2026-08-18 20:27 ` [LTP] " linuxtestproject.agent
2026-08-21 17:01 ` Samir M
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=20260821183919.8954-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=ltp@lists.linux.it \
--cc=samir@linux.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox