On 3/11/26 4:49 AM, Lucas Liu wrote:
Hi recently I met this issue
./test_kmem
ok 1 test_kmem_basic
ok 2 test_kmem_memcg_deletion
ok 3 test_kmem_proc_kpagecgroup
ok 4 test_kmem_kernel_stacks
ok 5 test_kmem_dead_cgroups
memory.current 24514560
percpu 15280000
not ok 6 test_percpu_basic
In this test the memory.current 24514560, percpu 15280000, Diff ~9.2MB.
#define MAX_VMSTAT_ERROR (4096 * 64 * get_nprocs())
in this part (8cpus) MAX_VMSTAT_ERROR is 4M memory. On the RT kernel,
the labs(current - percpu) is 9.2M, that is the root cause for this
failure. I am not sure what value is suitable for this case(2M per cpu
maybe?)
Li Wang had posted patches to address some of the problems in this test.
https://lore.kernel.org/lkml/[email protected]/
It could be the case that lazy percpu stat flushing can also be a factor
here. In this case, we may need to reread the stat counters again
several time with some delay to solve this problem.
Cheers,
Longman