poll problem?

Karlis Peisenieks (karlis@mt.lv)
Thu, 17 Oct 2002 12:32:00 +0300


Hello!

While using poll with rather large timeouts I came across a "problem" with
maximum timeout value that can be passed to poll. By reading manpage
people can expect that maximum timeout they can specify is 2^31 ms or ~596
hours (here and on I assume i386). In reality maximum timeout is HZ
dependent and value larger than max is treated the same as negative
timeout ("infinite" as per manpage, MAX_SCHEDULE_TIMEOUT in HZ units in
reality). With HZ == 100 this value is ~6 hours (MAX_SCHEDULE_TIMEOUT /
100). With HZ == 1000 this value is only ~35min!

And now questions:
- is this how it is supposed to be (then manpage should be fixed)?
- perhaps current approach of timeout calc should be changed so that for
large (> MAX_SCHEDULE_TIMEOUT / HZ) timeout values some other method (not
that precise, e.g. : timeout = (timeout / 1000) * HZ) should be used?

Karlis
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/