[LTP] hugetlb: Migrate library and numa helpers to libs/
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Sun May 31 02:08:21 CEST 2026
Hi Pradeep,
On Sun, 31 May 2026 00:41:23 +0100, Pradeep Susarla wrote:
> hugetlb: Migrate library and numa helpers to libs/
>
> Consolidate two test helpers into the global libs/ location, following
> the tse_ (extended, non-core library) naming adopted for libs/ (tst_ =
> core lib/, tse_ = extended libs/, tso_ = legacy):
>
> hugetlb library:
> testcases/kernel/mem/hugetlb/lib/hugetlb.h -> include/tse_hugetlb.h
> testcases/kernel/mem/hugetlb/lib/hugetlb.c -> libs/hugetlb/tse_hugetlb.c
> [...]
> write_node_cpusets():
> Moved from testcases/kernel/lib/numa_cpuset.c (libkerntest.a) into
> libs/numa/tse_numa.c (libltpnuma.a)
The patch bundles two independent migrations: the hugetlb library
(lib/hugetlb.c/h -> libs/hugetlb/) and write_node_cpusets()
(numa_cpuset.c -> libs/numa/). The two changes touch completely separate
test suites (hugetlb vs ksm/oom) and have no dependency on each other.
An intermediate state with only the hugetlb migration applied is
perfectly coherent.
Could these be split into two commits, one per migration, per the
"one logical change per patch" rule?
Pre-existing issues noticed in the surrounding code (not introduced
by this patch):
- libs/numa/tse_numa.c in gather_node_cpus() -- the trailing-comma
removal `cpus[strlen(cpus) - 1] = '\0'` is reached unconditionally
after the loop. If no CPUs are found (all offline or the node has
none), cpus[] remains empty, strlen(cpus) returns 0, and the
subtraction wraps to SIZE_MAX, writing outside the buffer. The guard
in write_node_cpusets() checks strlen(cpus) only after
gather_node_cpus() has already returned, so the write happens first.
This was present in the original numa_cpuset.c before the move.
---
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
More information about the ltp
mailing list