Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FE001EFF8B for ; Tue, 13 May 2025 06:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747119346; cv=none; b=MWChoA6HOJfgRYV7plW0NL+IS60JMgxugYtVY65I7t8ZHMuvgmNxao5jAY6UBbiRCgV0TueRRQjVDLK6/oxxyJalaokSIajLptO0Shh4kCvyE36UQDToLt05Iin1N0bjDA/Xd+Ox2tA9AcBGvmyfiJTZ2ElYLQ4fE8+gP56dwQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747119346; c=relaxed/simple; bh=MTb0pjCKOP0jtLT7OPG+1beusvLDzAk0iAshpwRvpkk=; h=Date:To:From:Subject:Message-Id; b=o8MbPEszpONBPY7Cu6+uA5DCCIJ8hSYwvPet3H5uJHcCAxPM8WGyXU/00PigNvskvvqHROA6hFhkGtt02ugJNCMUamfu6cbMJUyP4IMQUUH/tqCLYc4aEgxWgqXkn1+HFDY379z+0RcXdRW7VBpd4w6BGaXn6EDlVLWc2negc84= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IXWQzW6n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IXWQzW6n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74E93C4CEED; Tue, 13 May 2025 06:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1747119346; bh=MTb0pjCKOP0jtLT7OPG+1beusvLDzAk0iAshpwRvpkk=; h=Date:To:From:Subject:From; b=IXWQzW6nUNkzUVZsvtSkgeBIjv70Qswaz7t8zs7HIxCfMJm8M05nQH9umsE6PCbhe pDxcgwuBTJFr6pKEBlUaGzAn9aVi/E74wG6JGAYKFNKkNcUYpZ+MUTOFmwuFaMXlRa XLpFS6AAZxOHJ8TevZaOzW3VBKkqrdZeHJyKV0es= Date: Mon, 12 May 2025 23:55:45 -0700 To: mm-commits@vger.kernel.org,tj@kernel.org,shuah@kernel.org,shakeel.butt@linux.dev,roman.gushchin@linux.dev,muchun.song@linux.dev,mkoutny@suse.com,mhocko@kernel.org,hannes@cmpxchg.org,longman@redhat.com,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] selftests-memcg-increase-error-tolerance-of-child-memorycurrent-check-in-test_memcg_protection.patch removed from -mm tree Message-Id: <20250513065546.74E93C4CEED@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: selftests: memcg: increase error tolerance of child memory.current check in test_memcg_protection() has been removed from the -mm tree. Its filename was selftests-memcg-increase-error-tolerance-of-child-memorycurrent-check-in-test_memcg_protection.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Waiman Long Subject: selftests: memcg: increase error tolerance of child memory.current check in test_memcg_protection() Date: Thu, 1 May 2025 21:04:43 -0400 The test_memcg_protection() function is used for the test_memcg_min and test_memcg_low sub-tests. This function generates a set of parent/child cgroups like: parent: memory.min/low = 50M child 0: memory.min/low = 75M, memory.current = 50M child 1: memory.min/low = 25M, memory.current = 50M child 2: memory.min/low = 0, memory.current = 50M After applying memory pressure, the function expects the following actual memory usages. parent: memory.current ~= 50M child 0: memory.current ~= 29M child 1: memory.current ~= 21M child 2: memory.current ~= 0 In reality, the actual memory usages can differ quite a bit from the expected values. It uses an error tolerance of 10% with the values_close() helper. Both the test_memcg_min and test_memcg_low sub-tests can fail sporadically because the actual memory usage exceeds the 10% error tolerance. Below are a sample of the usage data of the tests runs that fail. Child Actual usage Expected usage %err ----- ------------ -------------- ---- 1 16990208 22020096 -12.9% 1 17252352 22020096 -12.1% 0 37699584 30408704 +10.7% 1 14368768 22020096 -21.0% 1 16871424 22020096 -13.2% The current 10% error tolerenace might be right at the time test_memcontrol.c was first introduced in v4.18 kernel, but memory reclaim have certainly evolved quite a bit since then which may result in a bit more run-to-run variation than previously expected. Increase the error tolerance to 15% for child 0 and 20% for child 1 to minimize the chance of this type of failure. The tolerance is bigger for child 1 because an upswing in child 0 corresponds to a smaller %err than a similar downswing in child 1 due to the way %err is used in values_close(). Before this patch, a 100 test runs of test_memcontrol produced the following results: 17 not ok 1 test_memcg_min 22 not ok 2 test_memcg_low After applying this patch, there were no test failure for test_memcg_min and test_memcg_low in 100 test runs. However, these tests may still fail once in a while if the memory usage goes beyond the newly extended range. Link: https://lkml.kernel.org/r/20250502010443.106022-3-longman@redhat.com Signed-off-by: Waiman Long Acked-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/cgroup/test_memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/cgroup/test_memcontrol.c~selftests-memcg-increase-error-tolerance-of-child-memorycurrent-check-in-test_memcg_protection +++ a/tools/testing/selftests/cgroup/test_memcontrol.c @@ -496,10 +496,10 @@ static int test_memcg_protection(const c for (i = 0; i < ARRAY_SIZE(children); i++) c[i] = cg_read_long(children[i], "memory.current"); - if (!values_close(c[0], MB(29), 10)) + if (!values_close(c[0], MB(29), 15)) goto cleanup; - if (!values_close(c[1], MB(21), 10)) + if (!values_close(c[1], MB(21), 20)) goto cleanup; if (c[3] != 0) _ Patches currently in -mm which might be from longman@redhat.com are