Re: [LTP] [PATCH v9 1/2] cpuset02: Convert the test6 from cpuset_memory_testset.sh to C code

Li Wang via ltp
2025-03-31T11:06:04Z

On Mon, Mar 31, 2025 at 6:37 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Wei, Li, Cyril,
>
> ...
> > +static void setup(void)
> > +{
> > + node = tst_get_nodemap(TST_NUMA_MEM, getpagesize() / 1024);
> > + if (node->cnt <= 1)
> > + tst_brk(TCONF, "test requires at least 2 NUMA memory
> nodes");
>

> Naive question: why test requires 2 memory nodes? Wouldn't be 1 enough?
>

Because test6 verify that hugepage + cpuset works well, so if we only use
1 node for testing, the allocated hugepage will always happen on that node.
Then we would lose the chance to find bug that there possibly allocated
from other nodes when setting the cpuset.

So this test needs at least two NUMA nodes.

--
Regards,
Li Wang