drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / damon / debugfs_target_ids_pid_leak.sh
blob31fe33c2b032568db139c8e8021cea2a678eb095
1 #!/bin/bash
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 ]
17 then
18 echo "maybe pids are leaking"
19 exit 1
20 else
21 exit 0