Usermode busy waiting for performance gains#56
Open
ck0i wants to merge 1 commit intokrispybyte:masterfrom
Open
Usermode busy waiting for performance gains#56ck0i wants to merge 1 commit intokrispybyte:masterfrom
ck0i wants to merge 1 commit intokrispybyte:masterfrom
Conversation
Replaces blocking WaitForSingleObject calls with busy-wait polling in SendReadRequest and SendWriteRequest. Reads use a sentinel value on the destination buffer to detect completion as soon as MmCopyVirtualMemory overwrites it, before the kernel even signals KmEvent. Writes spin-poll the event with zero timeout to avoid thread scheduler wake-up latency.
Owner
|
Currently, I am still debating whether or not I want #38 implemented or not, since it obviously spikes CPU core usage due to the busy-waiting. I am not sure whether this trade off is worth it for roprw. perhaps we could consider some toggle setting for usage/when compiling the project? |
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.

Summary
WaitForSingleObject(INFINITE)with busy-wait polling inSendReadRequestandSendWriteRequest0xC0FEBABEC0FEBABE) written to the destination buffer, detecting completion as soon asMmCopyVirtualMemoryoverwrites it before the kernel even signalsKmEventCloses #38
Test plan