Hacker News new | past | comments | ask | show | jobs | submit login

Care to elaborate on that?



The linux kernel's basic time unit is the jiffy, which wraps around every ~497 days and is visible to userspace using clock_gettime(CLOCK_MONOTONIC). In order to make sure that bugs don't occur only after 497 days, the jiffy value doesn't start at 0. Rather, the boot-time value is such that the jiffy value will wrap around after five minutes.

One of my brothers worked for an embedded device manufacturer that got bitten. The software worked great unless it was started in the first five minutes after a reboot. But since booting and waiting five minutes is easy, the fix was, too.

The nonzero boot-time value made it simple to fix a bug that occurs every 497 days. Fantastic, say I.


What a great solution! It's a "hostile" move that probably ends up preventing countless bugs in high-uptime systems.


Ha, looks like they did not fix the bug?

That is, they did not account for wraparound, they just avoided it. Is that correct?


Where my brother worked, you mean? They ensured that their software measured speed correctly in the hosts's fifth minute of uptime, and in all other minutes too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: