Skip to content
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

Fix application + uffd hangs due to not handling page faults #10448

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iziemba
Copy link
Contributor

@iziemba iziemba commented Oct 9, 2024

In order to receive unmap events, uffd uses 'mode missing' when registering memory regions. This implies getting page fault events as well. So handle them by returning a zero-filled page.


ret = ioctl(uffd.fd, UFFDIO_ZEROPAGE, &zp);

if (0 == ret) { /* success */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the constant at the right side of the comparison. Not about which way is better, but to keep the convention consistent. Same for other similar instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Also, I think this PR can be squashed into a single commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also fix those similar places that this comment applies to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

In order to receive unmap events, uffd uses 'mode missing'
when registering memory regions. This implies getting page
fault events as well. So handle them by returning a zero-filled page.

Page faults come in 3 flavors: reads, writes and writes to protected
pages.  The only ones we can handle are writes to non-backed pages.

Signed-off-by: Mike Uttormark <mike.uttormark@hpe.com>
Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
@a-szegel
Copy link
Contributor

bot:aws:retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants