<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/source/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in math.c</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>a9aba476d42df2537403f97f185a2b1979d0dd97 - rust: time: add Delta::to_jiffies_timeout() for timeout conversion</title>
        <link>http://kernelsources.org:8080/source/history/linux/rust/helpers/math.c#a9aba476d42df2537403f97f185a2b1979d0dd97</link>
        <description>rust: time: add Delta::to_jiffies_timeout() for timeout conversionThe boundaries of __msecs_to_jiffies() and nsecs_to_jiffies64() dependon which HZ branch is compiled. With CONFIG_HZ_300nsecs_to_jiffies64() overflows after 64.99 years, which is less thanthe 292 years a Delta can hold. With HZ=1000 a jiffy is a millisecond,so __msecs_to_jiffies() returns its argument unchanged and never capsit at MAX_JIFFY_OFFSET.Compute the conversion in Rust with mul_u64_add_u64_div_u64() instead. Itreturns (a * b + c) / d, computing a * b internally in 128 bits, soceil(nanos * HZ / NSEC_PER_SEC) needs no input clamp and rounds once. Thebound then follows from the arithmetic: with HZ &lt;= NSEC_PER_SEC, which astatic_assert() checks, the result is at most the nanosecond count.Unless the result saturates, the value is rounded up, so the timeout isnever shorter than the requested span. It saturates at zero jiffies for anegative span, i.e. an immediate timeout, and at MAX_JIFFY_OFFSET, theupper bound the kernel uses for a jiffies span. Since MAX_JIFFY_OFFSET isderived from long, only 32 bit can reach it, and a saturated timeout thereis finite, so it can be shorter than the requested span.Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;Link: https://msgid.link/20260924232530.446588-3-tomo@flapping.orgSigned-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;

            List of files:
            /linux/rust/helpers/math.c</description>
        <pubDate>Fri, 25 Sep 2026 01:25:30 +0200</pubDate>
        <dc:creator>FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;</dc:creator>
    </item>
</channel>
</rss>
