Skip to content

sched/event: Skip post processing without waiters - #21034

Open
anchao wants to merge 1 commit into
apache:masterfrom
anchao:26102707
Open

anchao wants to merge 1 commit into
apache:masterfrom
anchao:26102707

Conversation

@anchao

@anchao anchao commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Optimize nxevent_post() by skipping waiter wakeup processing when the event
wait list is empty.

The posted event bits are still updated first, so future waiters can observe
the posted event state as before. If there are no tasks currently waiting on
the event object, the function now returns immediately instead of preparing
post-processing state and iterating over an empty wait list.

This avoids unnecessary work in the common case where events are posted before
any task is waiting for them.

Impact

No user-visible behavior change is expected.

Expected impact:

  • reduces overhead when posting events with no current waiters
  • preserves existing event state semantics for future waiters
  • does not change wakeup behavior when waiters are present
  • no API, ABI, build-system, documentation, or security impact is expected

Testing

sim/nsh

Avoid preparing wakeup state when posting events to an empty wait list.
The event bits are still updated before returning so future waiters observe
the posted state.

Signed-off-by: chao an <anchao.archer@bytedance.com>
@anchao
anchao requested a review from jerpelea as a code owner October 27, 2026 09:10
@github-actions github-actions Bot added Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants