[lts94] Backport missing commit to fix userfaultfd kselftest hang #622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://ciqinc.atlassian.net/browse/LE-4335
When testing an lts-9.4 content release in a vm using the kernel-kselftest-internal kselftest runner, the tests will hang at the following point:
At the same time the following warning can be seen in the vms dmesg:
The site of the WARN looks like this in ciqlts9_4
CONFIG_PTE_MARKER is not set in the ciqlts9_4 config and so, according to the comment, we should never be calling this function. This led me to look at the commits that have been made to swapops.h hoping that I could see how we got into this situation. That led me to the following commit:
804153f
This commit adds a caller of make_pte_caller_entry that is outside of the CONFIG_PTE_MARKER check. It turns out that this commit was made to the upstream kernel as the second of a two commit series, the first of which changes the kernel to always compile in pte markers:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/swapops.h?id=ca92ea3dc5a2b01f98e9f02b7a6bc03be06fe124
This should have been backported at the same time as the
mm: use pte markers for swap errors
commit. If I add this commit to ciqlts9_4 and run the userfaultfd test again the warning is not seen and the test does not hang.