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 1 commit into
base: caprevoke
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
Maintain a list of processes sharing each vmspace so they can be scanned
efficently.

In addition to thread_single() on the revoking process, add
stop_vmspace_proc() which stops all other processes that share our
vmspace following the model of stop_all_proc().  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.
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.

None yet

1 participant