* [PATCH v2] selftests: cgroup: fix test_kmem_basic slab1 check
@ 2023-08-03 16:00 Lucas Karpinski
2023-08-03 16:08 ` Johannes Weiner
0 siblings, 1 reply; 2+ messages in thread
From: Lucas Karpinski @ 2023-08-03 16:00 UTC (permalink / raw)
To: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt,
Muchun Song, Tejun Heo, Zefan Li, Shuah Khan
Cc: Muchun Song, cgroups, linux-mm, linux-kselftest, linux-kernel
test_kmem_basic creates 100,000 negative dentries, with each one mapping
to a slab object. After memory.high is set, these are reclaimed through
the shrink_slab function call which reclaims all 100,000 entries. The
test passes the majority of the time because when slab1 is calculated,
it is often above 0, however, 0 is also an acceptable value.
Signed-off-by: Lucas Karpinski <lkarpins@redhat.com>
---
https://lore.kernel.org/all/m6jbt5hzq27ygt3l4xyiaxxb7i5auvb2lahbcj4yaxxigqzu5e@5rn6s2yjzv7u/
V2: Corrected title
tools/testing/selftests/cgroup/test_kmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c
index 258ddc565deb..ba0a0bfc5a98 100644
--- a/tools/testing/selftests/cgroup/test_kmem.c
+++ b/tools/testing/selftests/cgroup/test_kmem.c
@@ -71,7 +71,7 @@ static int test_kmem_basic(const char *root)
cg_write(cg, "memory.high", "1M");
slab1 = cg_read_key_long(cg, "memory.stat", "slab ");
- if (slab1 <= 0)
+ if (slab1 < 0)
goto cleanup;
current = cg_read_long(cg, "memory.current");
--
2.41.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] selftests: cgroup: fix test_kmem_basic slab1 check
2023-08-03 16:00 [PATCH v2] selftests: cgroup: fix test_kmem_basic slab1 check Lucas Karpinski
@ 2023-08-03 16:08 ` Johannes Weiner
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Weiner @ 2023-08-03 16:08 UTC (permalink / raw)
To: Lucas Karpinski
Cc: Michal Hocko, Roman Gushchin, Shakeel Butt, Muchun Song,
Tejun Heo, Zefan Li, Shuah Khan, cgroups, linux-mm,
linux-kselftest, linux-kernel
On Thu, Aug 03, 2023 at 12:00:47PM -0400, Lucas Karpinski wrote:
> test_kmem_basic creates 100,000 negative dentries, with each one mapping
> to a slab object. After memory.high is set, these are reclaimed through
> the shrink_slab function call which reclaims all 100,000 entries. The
> test passes the majority of the time because when slab1 is calculated,
> it is often above 0, however, 0 is also an acceptable value.
>
> Signed-off-by: Lucas Karpinski <lkarpins@redhat.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> @@ -71,7 +71,7 @@ static int test_kmem_basic(const char *root)
>
> cg_write(cg, "memory.high", "1M");
> slab1 = cg_read_key_long(cg, "memory.stat", "slab ");
> - if (slab1 <= 0)
> + if (slab1 < 0)
> goto cleanup;
This conflicts with a recent patch already queued up in -mm:
selftests: cgroup: fix test_kmem_basic false positives
which adds a sleep(1) between cg_write() and cg_read_key_long().
Can you please rebase on top of
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
and re-send the patch with
To: Andrew Morton <akpm@linux-foundation.org>
? Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-03 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 16:00 [PATCH v2] selftests: cgroup: fix test_kmem_basic slab1 check Lucas Karpinski
2023-08-03 16:08 ` Johannes Weiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox