netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
Cc: shemminger@osdl.org, netdev@vger.kernel.org
Subject: Re: [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS
Date: Wed, 21 May 2008 18:56:42 +0200	[thread overview]
Message-ID: <4834544A.4010706@trash.net> (raw)
In-Reply-To: <20080521163815.GA5028@sc.homeunix.net>

Stephane Chazelas wrote:
> Hi Stephen,
> 
> there seems to be something wrong with the timer values as
> processed by at least the "ss" and "ip" commands when
> CONFIG_HIGH_RES_TIMERS is on.
> 
> $ zgrep -e HZ= -e HIGH_RES /proc/config.gz
> CONFIG_HIGH_RES_TIMERS=y
> CONFIG_HZ=250
> 
> For instance, the "ip route rtt <time>" and 
> rto values returned by PROC_NET_TCP=/proc/net/tcp ss -i
> look incorrect:
> 
> $ PROC_NET_TCP=/proc/net/tcp ss -i
> State       Recv-Q Send-Q  Local Address:Port      Peer Address:Port
> ESTAB       0      0           127.0.0.1:35466        127.0.0.1:10198    rto:5.5e-08
> [...]
> 
> $ ss -i
> State       Recv-Q Send-Q  Local Address:Port      Peer Address:Port
> ESTAB       0      0           127.0.0.1:35466        127.0.0.1:10198
>         bic wscale:7,7 rto:220 rtt:23.5/19 send 11.2Mbps rcv_space:32792
> 
> 
> $ ip route show
> 10.95.131.111 via 10.95.128.1 dev eth0  rtt 5ms
> 
> $ netstat -rn
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
> 10.95.131.111   10.95.128.1     255.255.255.255 UGH       0 0     5000000 eth0
> 
> I think this is because get_hz gets the HZ value from the fourth
> field in /proc/net/psched. That's 1e9 in my case, because that's
> meant to be the frequency of CLOCK_MONOTONIC and when
> CONFIG_HIGH_RES_TIMERS is on, the CLOCK_MONOTONIC resolution is
> 1ns. So get_hz returns 1,000,000,000 instead of 250 in my case.
> 
> I don't know how to get the right value, clock_getres return 1ns
> as well.
> 
> That's with 2.6.24.2, iproute-20080108 from debian (but the GIT
> head code looks the same).


Both ss and ip route shouldn't be using get_hz(). inet_diag
is using fixed units anyway, the routing metrics should to.

/proc/net/psched is *only* for packet schedulers and they
want to know the real clock resolution.

  reply	other threads:[~2008-05-21 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 16:38 [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS Stephane Chazelas
2008-05-21 16:56 ` Patrick McHardy [this message]
2008-05-21 17:40   ` [PATCH] net: neighbour table ABI problem Stephen Hemminger
2008-05-21 20:35     ` David Miller
2008-05-22  0:20       ` Thomas Graf
2008-06-03 23:03         ` David Miller
2008-05-21 17:10 ` [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS Stephen Hemminger
2008-05-21 18:43   ` route metrics in jiffies?? Stephen Hemminger
2008-05-21 20:31     ` David Miller
2008-05-22 10:36     ` rtt metric only for incoming connections? Stephane Chazelas
2008-05-27 18:43       ` Stephen Hemminger
2008-05-27 18:53         ` Rick Jones

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=4834544A.4010706@trash.net \
    --to=kaber@trash.net \
    --cc=Stephane_Chazelas@yahoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /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).