Skip to content

Remove or default-disable forkproxy waitpid workarounds #1261

@sporksmith

Description

@sporksmith

To address #1134, we implemented a workaround that uses proxy threads to fork the plugin threads (keeping the plugins out of the worker child list), and ptrace-detaches plugins on every blocking syscall (keeping the tracee list at size 1). While this workaround is a performance improvement overall for large simulations, the ptrace detaching-and reattaching adds substantial linear overhead.

Since then we've implemented a more performant solution of scaling the number of worker threads with the number of hosts, so that each worker thread only has a small number of children/tracees. While this has some extra memory and context-switching overhead, it generally appears to be a more performant solution since it doesn't require ptrace detaching-and-reattaching. (It also enables work stealing without detaching and reattaching).

We should probably at least disable the old workarounds by default before release. It probably makes sense to go a step further and remove them entirely, but we may need more evaluation to know for sure. e.g. it might turn out that in some cases it's better to take the performance hit of detaching and reattaching to avoid the extra memory cost of using more worker threads.

Metadata

Metadata

Assignees

Labels

Component: MainComposing the core Shadow executablePriority: MediumImportant but not urgentTag: PerformanceRelated to improving shadow's run-time

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions