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

Page faults: add support for custom fault handlers #2064

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

francescolavra
Copy link
Member

This allows custom mmap() implementations for specific file descriptors to handle page faults on mmap()ed memory. This feature
is used by the Nvidia GPU klib.
The first commit allows reading from the page cache with non-contextual completion closures, such as when the reading context suspends itself and the completion resumes the suspended context (this happens in the Nvidia GPU klib when reading the GPU firmware file).

The existing code is assuming that the completion passed to
pagecache_read_sg() is a contextual closure. This prevents reading
from the page cache with a completion that is not a contextual
closure, such as when the reading context suspends itself and the
completion resumes the suspended context (this happens in the
Nvidia GPU klib when reading the GPU firmware file).
This change allows reading from the page cache with non-contextual
completion closures.
This allows custom mmap() implementations for specific file
descriptors to handle page faults on mmap()ed memory. This feature
is used by the Nvidia GPU klib.
The new_pending_fault_locked() function is no longer static so that
it can be called from an arbitrary fault handler when a fault
cannot be resolved synchronously.
@francescolavra francescolavra merged commit d9dc4e0 into master Sep 16, 2024
7 checks passed
@francescolavra francescolavra deleted the feature/vmap-fault branch September 16, 2024 13:10
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.

1 participant