anchao opened a new pull request, #21061:
URL: https://github.com/apache/nuttx/pull/21061
## Summary
This PR reduces unnecessary work in the generic timer paths by avoiding
notification operations when there is nothing to notify.
## Changes
- Skip `poll_notify()` in the timer callback when no poll waiter is
registered.
- Skip `nxsig_notification()` for timer and oneshot callbacks when
notification
is disabled with `SIGEV_NONE`.
- Avoid a duplicate current tick query in `up_alarm_tick_cancel()` when
`CONFIG_ONESHOT_COUNT` is enabled, because `ONESHOT_TICK_CANCEL()` already
samples the current tick in that configuration.
## Motivation
Periodic timer callbacks may run frequently. Calling into poll or signal
notification helpers when there are no waiters or no enabled notification
adds
avoidable overhead to the timer expiration path.
For the tick alarm cancel path, `ONESHOT_TICK_CANCEL()` already retrieves
the
current tick under `CONFIG_ONESHOT_COUNT`, so the extra
`ONESHOT_TICK_CURRENT()` call performs a redundant lower-half counter read.
## Testing
sim/nsh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]