genodelabs / genode

Genode OS Framework
https://genode.org/
Other
1.07k stars 254 forks source link

timer: reduce interference between timer sessions #5138

Closed nfeske closed 2 months ago

nfeske commented 7 months ago

The work on the time-driven new audio infrastructure (#5097) uncovered an unexpected degree of interference between timer clients. This observation prompted me to reconsider the current timer implementation(s). I'd like to achieve the following:

I will turn my immediate attention to the NOVA timer driver.

nfeske commented 7 months ago

My timer branch (https://github.com/nfeske/genode/commits/timer/) contains my first take of the new implementation, tested via pkg/test-timer as well as sculpt.run (on Qemu). I haven't tested it with the audio scenario yet.

On Sculpt on Qemu, once the system has settled, top shows a similar load as the original version. Upon closer inspection, most of the load seems to be induced by the ahci-1.fs server, which calls trigger_once about 200 times per second.

nfeske commented 7 months ago

Version https://github.com/nfeske/genode/commit/c8a05b2a5b45ece959c56b42325d4a916d17781c replaces the RPC-based synchronization by a simple locking scheme, which is a little bit faster and alleviates the need for the component-internal RPC interface. To quantify the performance change, I tested the idle load with Sculpt on an x250, which is pretty much influenced by the timer.

nfeske commented 7 months ago

After testing the waveform_player.run script on my x250, I'm happy to report that the new timer indeed solves the cross-session interference problem.

nfeske commented 7 months ago

Commit https://github.com/genodelabs/genode/commit/6a36ab585ea5fbacafa704291b4d4114524bc113 contains the new version of the base-hw timer.

alex-ab commented 5 months ago

I finished the adjusted pit timer implementation. run/timeout on Qemu succeed for me on Qemu for sel4, okl4 and pistachio.

nfeske commented 5 months ago

Nice! Thanks @alex-ab for the new implementation, which I merged to staging just now. Curious to see how it fares for the other scenarios.

alex-ab commented 4 months ago

@nfeske: I updated the fiasco timer, please have a look, works for me on qemu with run/timeout and run/timer_accuarcy

nfeske commented 4 months ago

Thanks a lot @alex-ab! The new version looks very nice. Merged to staging.

alex-ab commented 4 months ago

@nfeske: the adjusted foc and linux timers are available

nfeske commented 4 months ago

Thanks @alex-ab, very much appreciated!

alex-ab commented 4 months ago

@nfeske, @skalk: as discussed, i removed the old timer driver for epit from repos/base and repos/base-sel4 with a30e88f5a211aa9798c9adb6ac50e524ae510129 and re-added the new to the imx repo https://github.com/alex-ab/genode-imx/commit/ff903b35b86bbe3361b84816cb7d33af80a0064e. The old server side timer infrastructure seems not to be used now anymore, so 8c97e258a356ea797c9dc349920604b2c16b648e removes the code.

nfeske commented 4 months ago

I merged the epit commits to the respective staging branches. Thanks a lot @alex-ab for the so nicely wrapping up this transition.