Re: [PATCH] [PATCH V2] memcg/memcontrol04: Fix race in pagecache allocation measurement

Andrea Cervesato via ltp <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Pavithra,

> The test was failing with memory.current values much lower than expected:
>    TFAIL: (A/B/C memory.current=6684672) ~= 34603008
>    TFAIL: (A/B/D memory.current=5373952) ~= 17825792
> 
> Root cause:
> Child processes allocating pagecache were exiting immediately after
> allocation (via tst_reap_children()), causing the pagecache to be
> freed before the test could measure memory.current values.
> 
> Fix:
> Modified alloc_pagecache_in_child() to keep children alive during test:
> - Added TEST_DONE checkpoint for child lifecycle coordination
> - Parent waits for CHILD_IDLE checkpoint before proceeding
> - Child signals CHILD_IDLE after allocation and fsync
> - Child waits for TEST_DONE to keep memory allocated during test
> - Modified cleanup_sub_groups() to wake waiting children before cleanup
> - Changed alloc_anon_in_child() to use SAFE_WAITPID() for specific child
> - Added num_children_spawned tracking for accurate cleanup

This commit message is extremely verbose, please make it simpler the
next time. Something explaining the root cause it's there and it's ok,
but the Fix: section is self explained inside the diff code.


The rest LGTM.

Reviewed-by: Andrea Cervesato <andrea.cervesato-IBi9RG/[email protected]>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato-IBi9RG/[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.