From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, maze@google.com,
paul.gortmaker@windriver.com, akpm@linux-foundation.org,
pyu@redhat.com
Subject: Re: [PATCH net-next] time: jiffies_delta_to_clock_t() helper to the rescue
Date: Thu, 09 Aug 2012 16:17:22 -0700 (PDT) [thread overview]
Message-ID: <20120809.161722.978110433246227213.davem@davemloft.net> (raw)
In-Reply-To: <1344496433.28967.443.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 09 Aug 2012 09:13:53 +0200
> 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.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Maciej Żenczykowski <maze@google.com>
Applied, thanks Eric.
next prev parent reply other threads:[~2012-08-09 23:17 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 [this message]
2012-08-13 15:52 ` Thomas Gleixner
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=20120809.161722.978110433246227213.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--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 \
--cc=tglx@linutronix.de \
/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).