On Thu May 1, 2025 at 4:38 PM UTC, Ujwal Kundur wrote:
This patchset refactors non-composite global variables into a common struct that can be initialized and passed around per-test instead of relying on the presence of global variables.
This allows:
- Better encapsulation
- Debugging becomes easier -- local variable state can be viewed per stack frame, and we can more easily reason about the variable mutations
Patch 1 needs to be applied first and can be followed by any of the other patches. I've ensured that the tests are passing locally (or atleast have the same output as the code on master).
Ujwal Kundur (4): selftests/mm/uffd: Refactor non-composite global vars into struct selftests/mm/uffd: Swap global vars with global test options selftests/mm/uffd: Swap global variables with global test opts selftests/mm/uffd: Swap global variables with global test opts
I tested this using this script:
https://github.com/bjackman/linux/blob/523e40a88fac34b17f49614dfb24fd5e18e63...
After manually enabling the userfaultfd tests (I disable them in my crappy CI thing as they are flaky):
https://github.com/bjackman/linux/blob/523e40a88fac34b17f49614dfb24fd5e18e63...
So
Tested-by: Brendan Jackman jackmanb@google.com