login
Header Space

 
 

[iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <shemminger@...>
Cc: <netdev@...>
Date: Wednesday, May 21, 2008 - 12:38 pm

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).

Best regards,
Stéphane
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS, Stephane Chazelas, (Wed May 21, 12:38 pm)
Re: [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS, Stephen Hemminger, (Wed May 21, 1:10 pm)
route metrics in jiffies??, Stephen Hemminger, (Wed May 21, 2:43 pm)
rtt metric only for incoming connections?, Stephane Chazelas, (Thu May 22, 6:36 am)
Re: rtt metric only for incoming connections?, Stephen Hemminger, (Tue May 27, 2:43 pm)
Re: rtt metric only for incoming connections?, Rick Jones, (Tue May 27, 2:53 pm)
Re: route metrics in jiffies??, David Miller, (Wed May 21, 4:31 pm)
Re: [iproute2] get_hz() with CONFIG_HIGH_RES_TIMERS, Patrick McHardy, (Wed May 21, 12:56 pm)
[PATCH] net: neighbour table ABI problem, Stephen Hemminger, (Wed May 21, 1:40 pm)
Re: [PATCH] net: neighbour table ABI problem, David Miller, (Wed May 21, 4:35 pm)
Re: [PATCH] net: neighbour table ABI problem, Thomas Graf, (Wed May 21, 8:20 pm)
Re: [PATCH] net: neighbour table ABI problem, David Miller, (Tue Jun 3, 7:03 pm)
speck-geostationary