-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
madvise06: Increase reliability and diagnostic info
When memcg.limit_in_bytes is set to PASS_THRESHOLD it's unlikely swapcached will increase by more than PASS_THRESHOLD unless processes in other memcgs are also increasing it. Additionally MADV_WILLNEED must remove pages from memory as it adds more so that the first page may not be in memory by the time the last page is faulted if the amount exceeds the memory limit (which it does because CHUNK_SZ > PASS_THRESSHOLD). Worse if pages are faulted in a non-linear way, or the process must access some other pages, then there is no guarantee which parts of the range will be resident in memory. This results in spurious test failures. To solve this we can set PASS_THRESHOLD to 1/4 of CHUNK_SZ and memcg.limit_in_bytes to 1/2 of CHUNK_SZ (MEM_LIMIT), then mark MEM_LIMIT bytes as needed. That way the amount in the SwapCache will easily be more than the threshold. Secondly we can run madvise again on PASS_THRESHOLD bytes and check that dirtying all of these does not result in too many page faults. We also run the second test on every occasion to ensure the test code itself is still valid. If the original bug is present then both tests fail. Finally this prints more diagnostic information to help with debugging the test. While debugging the test a kernel bug was found in 5.9 which effects CGroupV1 when use_hierarchy=0. This is unlikely to effect many users, but a fix is pending and will be referenced in the test when available. It is recommended that you set use_hierarchy=1. Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com> Reviewed-by: Li Wang <liwang@redhat.com>
- Loading branch information
1 parent
f4a9a98
commit 1ad945a
Showing
1 changed file
with
84 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters