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

stop and scan all procs sharing a vmspace #1640

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

brooksdavis
Copy link
Member

@brooksdavis brooksdavis commented Jan 28, 2023

A drafty and certainly somewhat broken first cut that doesn't immediatly blow up under current tests.

In addition to thread_single() on the revoking process, add stop_vmspace_proc() which stops all other processes that share our vmspace. It's a lightly modified copy of stop_all_proc() and walks the allproc list to find processes to suspend and repeats until there's no process left to suspend.

Known issues:

  • Nothing prevents multiple callers from entering stop_vmspace_proc() except that the revoker is the only caller
  • Walking the whole process list at least 6 times isn't very efficient even if we don't do anything with most of them. Might want a list in vmspace, but then we need a mutex...
  • I'm not sure if SINGLE_ALLPROC is ok or if we want a variant of SINGLE_BARRIER that works on procs other than curthread.

@brooksdavis brooksdavis force-pushed the caprevoke-unmapped-single branch 3 times, most recently from dc1bd41 to 8fd603e Compare February 14, 2023 23:03
@brooksdavis brooksdavis changed the base branch from caprevoke-unmapped-single to caprevoke February 21, 2023 19:22
@brooksdavis brooksdavis force-pushed the caprevoke-all-procs-in-vmspace branch from c9a0591 to baa179c Compare July 25, 2024 22:06
@brooksdavis brooksdavis changed the base branch from caprevoke to dev July 25, 2024 22:06
This will allow us to efficently act on all processes sharing a vmspace
(important with co-processes).
stop_vmspace_proc() and resume_vmspace_proc() respectively stop and
resume all processes but curproc associated with the vmspace of a
given process.  Functionally this the same a (stop|resume)_all_proc()
except that it walks the vmspace process list rather than allproc.

For each process use a new thread_single(SINGLE_VMSPACE) which acts like
SINGLE_BOUNDRY except that like SINGLE_ALLPROC it suspends all threads
in the process and does not expect proc to be curproc.
In addition to thread_single() on the revoking process, call
stop_vmspace_proc() to stop all other processes that share our
vmspace.  Then revoke the horders for each thread and process sharing
the vmspace.
@brooksdavis brooksdavis force-pushed the caprevoke-all-procs-in-vmspace branch from baa179c to 159c084 Compare July 25, 2024 23:54
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