Re: [PATCH AUTOSEL 5.17 089/135] kunit: bail out of test filtering logic quicker if OOM

Daniel Latypov
2022-05-31T16:15:48Z

On Mon, May 30, 2022 at 6:36 AM Sasha Levin <sashal@kernel.org> wrote:
>
> From: Daniel Latypov <dlatypov@google.com>
>
> [ Upstream commit a02353f491622e49c7ddedc6a6dc4f1d6ed2150a ]
>

Is it possible to make sure the fix for this commit gets picked up as well [1]?
I was waiting a bit to see if it was going to get picked up
automatically, but I don't see such an email yet:
https://lore.kernel.org/stable/?q=kunit+OOM
(Perhaps the automation just hasn't gotten around to it yet?)

Alternatively, reverting just this commit would also work, if that's easier.

[1] commit 1b11063d32d7e11366e48be64215ff517ce32217
Author: Daniel Latypov <dlatypov@google.com>
Date: Fri May 13 11:37:07 2022 -0700

kunit: fix executor OOM error handling logic on non-UML

The existing logic happens to work fine on UML, but is not correct when
running on other arches.

1. We didn't initialize `int err`, and kunit_filter_suites() doesn't
explicitly set it to 0 on success. So we had false "failures".
Note: it doesn't happen on UML, causing this to get overlooked.
2. If we error out, we do not call kunit_handle_shutdown().
This makes kunit.py timeout when using a non-UML arch, since the QEMU
process doesn't ever exit.

Fixes: a02353f49162 ("kunit: bail out of test filtering logic
quicker if OOM")
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

Without 1b11063d32d7 above, this "fix" breaks more cases than it fixes
due to my sloppiness.

Thanks,
Daniel