Re: [PATCH v3 04/13] selftest/mm: fix cgroup task placement and drop memory.current checks in hugetlb_reparenting_test.sh
From: Sayali Patil
Date: Fri Apr 03 2026 - 16:03:02 EST
On 01/04/26 19:38, David Hildenbrand (Arm) wrote:
On 3/27/26 08:15, Sayali Patil wrote:Yes, there is still a small race window in the current approach.
Launch write_to_hugetlbfs as a separate process and move only its PID
into the target cgroup before waiting for completion. This avoids moving
the test shell itself, prevents unintended charging to the shell, and
ensures hugetlb and memcg accounting is attributed only to the intended
workload.
Add a short delay before the hugetlb allocation to avoid a race where
memory may be charged before the task migration takes effect, which
can lead to incorrect accounting and intermittent test failures.
Isn't there still a chance for a race, for example, when running in a VM?
I am looking into making this more reliable with a deterministic synchronization mechanism to avoid such timing dependencies.
I will send a v4 with this improvement.
Thanks,
Sayali