Skip to content

sched/wqueue: Skip tick read for immediate work - #21036

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

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

Conversation

@anchao

@anchao anchao commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Avoid calculating an absolute expiration time for immediate workqueue items.

For regular workqueue submissions, work_qqueue() used to call
clock_delay2abstick(delay) even when delay == 0. Immediate work items are
queued directly to the expired list and do not use pending timer ordering, so
the current system tick read is unnecessary in that path.

This change only computes the absolute expiration time when the work item is a
non-periodic delayed work item (delay > 0).

Benefits

  • Avoids an unnecessary clock_systime_ticks() read for immediate work items
  • Keeps delayed work timing unchanged
  • Keeps periodic work_queue_next() behavior unchanged

Testing

sim/nsh

Avoid calculating an absolute expiration time for immediate work items
because they are queued directly on the expired list and do not use the
pending timer ordering.

Signed-off-by: chao an <anchao.archer@bytedance.com>
@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 →

qemu-armv8a

  • Code: .text.work_qqueue +12 B (+0.0%, 354,408 B)

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.

2 participants