On 9/4/26 6:06 PM, Sarthak Sharma wrote:
> gup_test.c currently serves two separate purposes: benchmarking
> (GUP_FAST_BENCHMARK, PIN_FAST_BENCHMARK and PIN_LONGTERM_BENCHMARK) and
> functional testing (GUP_BASIC_TEST, PIN_BASIC_TEST and
> DUMP_USER_PAGES_TEST). Keeping both in one program makes the functional
> tests harder to run and report individually, while run_vmtests.sh has to
> invoke the program repeatedly with different options.
>
> Separate these roles into tools/mm/gup_bench for benchmarking and
> tools/testing/selftests/mm/gup for functional testing. Move the shared
> file and hugepage helpers to tools/lib/mm/ so both programs can use them
> without duplicating the implementation.
>
I went through Sashiko's review on this patchset [1] and wanted to
address the concerns it raises.
Both the concerns here are false positives, as it assumes that
FIXTURE_TEARDOWN() will run if FIXTURE_SETUP() fails. But in the
kselftest harness, we initialize the variable no_teardown to true before
calling FIXTURE_SETUP() and make it false only when FIXTURE_SETUP()
completes successfully. So, if ASSERT_*() fails in FIXTURE_SETUP(),
FIXTURE_TEARDOWN() won't run. Therefore neither stdin will be closed nor
self->gup_fd will be closed twice.
[1]
https://sashiko.dev/#/patchset/20260904123631.198697-1-sarthak.sharma%40arm.com