WFE performance busy wait improvement#195
Open
ShahriarAhnaf wants to merge 1 commit intorenode:masterfrom
Open
WFE performance busy wait improvement#195ShahriarAhnaf wants to merge 1 commit intorenode:masterfrom
ShahriarAhnaf wants to merge 1 commit intorenode:masterfrom
Conversation
Three changes to fix WFE correctness and performance: 1. tlib: Set event register (sev_pending) on exception return in do_v7m_exception_exit() and do_v7m_secure_return(), per ARMv7-M ARM B1.4.2. Without this, firmware using WFE + ISR-sets-RAM-flag patterns deadlocks when the interrupt fires before the CPU reaches WFE. 2. tlib: Set event register on exception entry in do_interrupt_v7m(), per ARMv7-M ARM B1.4.2. Needed for nested exception scenarios. 3. tlib: Check and consume event register inline in HELPER(wfe) before halting. If sev_pending is set, clear it and return immediately instead of entering the WFI halt path. 4. BaseCPU: Sleep for the full remaining quantum during WFI/WFE instead of only the real-time pacing delta. sleeper.Interrupt() from OnGPIO wakes the thread early when an IRQ arrives, so host CPU usage drops from 100% to near-idle during WFE/WFI wait loops.
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.
Change for WFE performance: