check: run _check_filesystems in an OOM-happy subshell
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Jul 2021 00:21:34 +0000 (17:21 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 18 Jul 2021 14:32:29 +0000 (22:32 +0800)
commit473cf6fb2e5e6f3c472cf68d5c96907bd5f7b7d0
tree8941ac2a0f1a33a8aa0ee03d825cae0263577dd9
parentffaba0eb3fc1b9e05bea476fa59c3e9239dec361
check: run _check_filesystems in an OOM-happy subshell

While running fstests one night, I observed that fstests stopped
abruptly because ./check ran _check_filesystems to run xfs_repair.
In turn, repair (which inherited oom_score_adj=-1000 from ./check)
consumed so much memory that the OOM killer ran around killing other
daemons, rendering the system nonfunctional.

This is silly -- we set an OOM score adjustment of -1000 on the
./check process so that the test framework itself wouldn't get
OOM-killed, because that aborts the entire run.  Everything else is
fair game for that, including subprocesses started by
_check_filesystems.

Therefore, adapt _check_filesystems (and its children) to run in a
subshell with a much higher oom score adjustment.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
check