Skip to content

Commit 6043947

Browse files
lkarpins-rhakpm00
authored andcommitted
selftests: cgroup: fix test_kmem_basic less than error
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 or current is calculated, it is often above 0, however, 0 is also an acceptable value. Link: https://lkml.kernel.org/r/7d6gcuyzdjcice6qbphrmpmv5skr5jtglg375unnjxqhstvhxc@qkn6dw6bao6v Signed-off-by: Lucas Karpinski <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Zefan Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 49b0638 commit 6043947

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/cgroup/test_kmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ static int test_kmem_basic(const char *root)
7575
sleep(1);
7676

7777
slab1 = cg_read_key_long(cg, "memory.stat", "slab ");
78-
if (slab1 <= 0)
78+
if (slab1 < 0)
7979
goto cleanup;
8080

8181
current = cg_read_long(cg, "memory.current");
82-
if (current <= 0)
82+
if (current < 0)
8383
goto cleanup;
8484

8585
if (slab1 < slab0 / 2 && current < slab0 / 2)

0 commit comments

Comments
 (0)