-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uffd: Disable image deduplication after fork #2492
Conversation
Would it be possible to add a ZDTM test for this use-case? |
After a fork, both the child and parent processes may trigger a page fault (#PF) at the same virtual address, referencing the same position in the page image. If deduplication is enabled, the last process to trigger the page fault will fail. Therefore, deduplication should be disabled after a fork to prevent this issue. Signed-off-by: Liu Hua <[email protected]>
2b1acef
to
460e464
Compare
I will add a ZDTM testcase later. The follow test case can reproduce this issue.
|
460e464
to
93f0171
Compare
can you show some error message of this issuse? |
93f0171
to
d28996b
Compare
@rst0git @rppt I found it very difficult to disable background fetch. I cannot reliably reproduce this issue in the tests because the memory may be fetched by the background process before deduplication. However, I can reliably reproduce this issue with a large-memory process, which is not suitable for testing. Could you please consider merging this patch without the test? |
Please refer to the above testcase. |
d28996b
to
50d1265
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@liusdu Thank you for working on this!
After a fork, both the child and parent processes may trigger a page fault (#PF) at the same virtual address, referencing the same position in the page image. If deduplication is enabled, the last process to trigger the page fault will fail.
Therefore, deduplication should be disabled after a fork to prevent this issue.