Repository navigation
Conversation
Process_CreateForceData runs for every process created on the host and enumerated every configuration section, including all Templates.ini sections. Each one pinned the configuration through Conf_IsBoxEnabled, and Conf_AdjustUseCount took Conf_Lock exclusively, so concurrent process creations queued on the lock. Template sections are skipped in the scan: they sit at the end of the section list and carry no Enabled setting, so they never became force boxes. Conf_AdjustUseCount takes the lock shared. The count is changed with interlocked operations and Conf_Read still reads it under the exclusive lock before swapping the configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process_CreateForceData runs for every process started on the host and walks every config section, Templates.ini included. Conf_IsBoxEnabled pins the config for each one and Conf_AdjustUseCount takes Conf_Lock exclusively, so with 448 sections that is about 900 exclusive acquires per process. Threads creating processes at the same time queue on it.
On a machine starting about 80 processes per second a small native exe took 213 ms to start, 9 ms with Templates.ini cut down to 30 sections. In a wait trace 27956 of 27976 ERESOURCE waits were under PspCallProcessNotifyRoutines in SbieDrv.
Template sections are last in the list and have no Enabled setting, so skipping them drops nothing from the force list. Conf_Read still reads the use count under the exclusive lock before it swaps the config, so a shared acquire is enough in Conf_AdjustUseCount.