From: Thomas Gleixner <tglx@linutronix.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Maciej Żenczykowski" <maze@google.com>,
"Paul Gortmaker" <paul.gortmaker@windriver.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
hank <pyu@redhat.com>
Subject: Re: [PATCH net-next] time: jiffies_delta_to_clock_t() helper to the rescue
Date: Mon, 13 Aug 2012 17:52:44 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1208131749230.32033@ionos> (raw)
In-Reply-To: <1344496433.28967.443.camel@edumazet-glaptop>
On Thu, 9 Aug 2012, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Various /proc/net files sometimes report crazy timer values, expressed
> in clock_t units.
>
> This happens when an expired timer delta (expires - jiffies) is passed
> to jiffies_to_clock_t().
>
> This function has an overflow in :
>
> return div_u64((u64)x * TICK_NSEC, NSEC_PER_SEC / USER_HZ);
>
> commit cbbc719fccdb8cb (time: Change jiffies_to_clock_t() argument type
> to unsigned long) only got around the problem.
>
> As we cant output negative values in /proc/net/tcp without breaking
> various tools, I suggest adding a jiffies_delta_to_clock_t() wrapper
> that caps the negative delta to a 0 value.
That's correct for 64bit, but for 32bit you do the same for valid
timer values where expires < jiffies. So you might output 0 for valid
armed timers for quite a while around the point where jiffies are
close to the wrapping point.
Dunno if that's an issue, but it want's to be documented at least.
Thanks,
tglx
prev parent reply other threads:[~2012-08-13 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 7:13 [PATCH net-next] time: jiffies_delta_to_clock_t() helper to the rescue Eric Dumazet
2012-08-09 23:17 ` David Miller
2012-08-13 15:52 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.02.1208131749230.32033@ionos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=pyu@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).