Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    26a30376
    Change "hz" to fix poll() premature timeout · 26a30376
    Nadav Har'El authored
    msleep() measure times in units of 1/hz seconds. We had hz = 1,000,000,
    which gives excellent resolution (microsecond) but a terible range
    (limits msleep()'s timeout to 35 minutes).
    
    We had a program (Cassandra) doing poll() with a timeout of 2 hours,
    which caused msleep to think we gave a negative timeout.
    
    This patch reduces hz to 1,000, i.e., have msleep() operate in the same units
    as poll(). Looking at the code, I don't believe this change will have any
    ill-effects - we don't need higher resolution (freebsd code is used to
    hz=1,000, which is the default there), and the code converts time units to
    hz's correctly, always using the hz macro. The allowed range for timeouts will
    grow to over 24 days - and match poll()'s allowed range.
    26a30376
    History
    Change "hz" to fix poll() premature timeout
    Nadav Har'El authored
    msleep() measure times in units of 1/hz seconds. We had hz = 1,000,000,
    which gives excellent resolution (microsecond) but a terible range
    (limits msleep()'s timeout to 35 minutes).
    
    We had a program (Cassandra) doing poll() with a timeout of 2 hours,
    which caused msleep to think we gave a negative timeout.
    
    This patch reduces hz to 1,000, i.e., have msleep() operate in the same units
    as poll(). Looking at the code, I don't believe this change will have any
    ill-effects - we don't need higher resolution (freebsd code is used to
    hz=1,000, which is the default there), and the code converts time units to
    hz's correctly, always using the hz macro. The allowed range for timeouts will
    grow to over 24 days - and match poll()'s allowed range.
datasets NaN GiB