|
|
Log in / Subscribe / Register

Digging in the kernel dust

Digging in the kernel dust

Posted Oct 27, 2017 16:31 UTC (Fri) by zlynx (guest, #2285)
In reply to: Digging in the kernel dust by xorbe
Parent article: Digging in the kernel dust

The TLDR summary: timer slack caused requested socket timeout of 180 seconds to return after up to 190 seconds.

Code relied on this being an accurate timer even though it isn't specified to be accurate.


to post comments

Digging in the kernel dust

Posted Oct 28, 2017 6:46 UTC (Sat) by nijhof (subscriber, #4034) [Link]

If 90+% of the socket timeouts get cancelled anyway, then maybe one could use a hybrid timer: use a timer wheel timeout for 150s, then in the few cases that that triggers, calculate the actual waiting time and schedule a hires timeout for the remaining 30 - slack seconds?

Of course I don't know how easy it is to find out how long the timer wheel timer waited for exactly. And the locking to avoid canceling while rearming would be interesting...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds