2 # SPDX-License-Identifier: GPL-2.0
4 before
=$
(grep "^pid " /proc
/slabinfo |
awk '{print $2}')
6 nr_leaks
=$
(.
/debugfs_target_ids_pid_leak
1000)
7 expected_after_max
=$
((before
+ nr_leaks
/ 2))
9 after
=$
(grep "^pid " /proc
/slabinfo |
awk '{print $2}')
11 echo > /sys
/kernel
/debug
/damon
/target_ids
13 echo "tried $nr_leaks pid leak"
14 echo "number of active pid slabs: $before -> $after"
15 echo "(up to $expected_after_max expected)"
16 if [ $after -gt $expected_after_max ]
18 echo "maybe pids are leaking"