+
+struct test_results {
+ int prctl_get_thp_disable;
The result is always one, does that here make sense?
Its 3 in the next patch for PR_THP_DISABLE_EXCEPT_ADVISED :)
I will remove this struct, but I think maybe it might have been a good idea to squash this
with the next patch to show why the struct was useful.
I think it's reasonable to keep them separate.
+ int prctl_applied_collapse_none;
"prctl_applied" is a bit confusing. And most of these always have the same value.
Can't we special case the remaining two cases on the current policy and avoid this struct compeltely?
The values are different in the next patch when PR_THP_DISABLE_EXCEPT_ADVISED is used.
Just to explain how I came about using this struct test_results (though it doesnt matter as
I will remove it for the next revision):
I wanted to maximise code reuse and only wanted to have one instance of prctl_thp_disable_test.
I actually started with special casing, but went the brute force way of adding too many if else
statements and it was looking quite messy after I added the tests for PR_THP_DISABLE_EXCEPT_ADVISED.
I saw this struct test_results in another kselftest and thought this should make it much better and
extendable.
I have removed struct test_results and changed prctl_thp_disable_test to the following for next revision:
Yeah, or just duplicate that function and call it
prctl_thp_disable_unless_advised_test() in the next patch.
Makes the code easier to read and the duplication is limited.
--
Cheers,
David / dhildenb