g2gps opened a new pull request, #12433:
URL: https://github.com/apache/nuttx/pull/12433
## Summary
Cache the next timeout value in the drivers instance and update the mtimecmp
value once. This is advantageous as the opensbi ecall to set the timer is
expensive in systems which don't have the supervisor mode timer extension.
## Impact
Mild reduction in the mtimer interrupt time, when CONFIG_SCHED_TICKLESS is
used, on the Litex platform.
Before
```
IRQ HANDLER ARGUMENT COUNT RATE (s) TOTAL TIME(us) MEAN TIME(us) MAX
TIME(us)
21 40015396 40434f10 1204 12.607 162752
135 463 // os test
21 40015396 40434f10 2669 850.426 580978
217 718 // custom application
```
With this change
```
IRQ HANDLER ARGUMENT COUNT RATE (s) TOTAL TIME(us) MEAN TIME(us) MAX
TIME(us)
21 40015396 40434f10 1217 11.898 142299
116 390 // os test
21 40015396 40434f10 2043 808.788 372405
182 619 // custom application
```
## Testing
[ostest_knsh32_new.txt](https://github.com/user-attachments/files/15509036/ostest_knsh32_new.txt)
[ostest_knsh32_old.txt](https://github.com/user-attachments/files/15509037/ostest_knsh32_old.txt)
[ostest_knsh64_new.txt](https://github.com/user-attachments/files/15509038/ostest_knsh64_new.txt)
[ostest_knsh64_old.txt](https://github.com/user-attachments/files/15509039/ostest_knsh64_old.txt)
[ostest_litex.txt](https://github.com/user-attachments/files/15509041/ostest_litex.txt)
Note: OS test on qemu32 and qemu64 both return -1 before and after this
change.
It would be great if this change could be tested on another hardware
platform.
--
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]