Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Patrick McManus <mcmanus@...>
Cc: Ingo Molnar <mingo@...>, Ilpo Järvinen <ilpo.jarvinen@...>, Peter Zijlstra <peterz@...>, LKML <linux-kernel@...>, Netdev <netdev@...>, David S. Miller <davem@...>, Rafael J. Wysocki <rjw@...>, Andrew Morton <akpm@...>, Evgeniy Polyakov <johnpol@...>
Date: Sunday, June 1, 2008 - 2:04 am

Patrick McManus a écrit :

I believe Ingo problems come on long lived sockets (were many bytes were 
exchanged between the peers), so I dont think DEFER_ACCEPT is the cullprit.

I suggest to enable CONFIG_TIMER_STATS and to check timers, because 
/proc/net/tcp
can display apparently large timer values when the timer is elapsed 
(jiffies > icsk->icsk_timeout)
and jiffies_to_clock_t(timer_expires - jiffies) is then overflowing 
doing a multiply and a divide.

On a 64bits server running linux-2.6.24-rc2, I can see *strange* timers 
values too in /proc/net/tcp, but not
stuck TCP sessions. On 64 bits, these strange values have 1AD7F

grep 1AD7F /proc/net/tcp | obfuscate_IP_and_ports

2017: local_peer remote_peer 03 00000000:00000000 01:1AD7F29ABBA 
00000001     0        0 0 2 ffff81067e7520c0
2019: local_peer remote_peer 03 00000000:00000000 01:1AD7F29ABBA 
00000003     0        0 0 2 ffff8106c580bcc0
2029: local_peer remote_peer 03 00000000:00000000 01:1AD7F29ABBA 
00000002     0        0 0 2 ffff81067313fe40
2032: local_peer remote_peer 03 00000000:00000000 01:1AD7F29ABBA 
00000003     0        0 0 2 ffff8106c716c340
2039: local_peer remote_peer 03 00000000:00000000 01:1AD7F29ABBA 
00000002     0        0 0 2 ffff8107d45b3f40
2041: local_peer remote_peer 03 00000000:00000000 01:1AD7F29AB37 
00000000     0        0 0 2 ffff810718e221c0
6610: local_peer remote_peer 01 00000000:00000000 00:1AD7F29ABCA 
00000000     0        0 136594789 1 ffff8107183fb940 94 10 16 2 -1
9925: local_peer remote_peer 01 00000000:00000000 00:1AD7F29ABCA 
00000000     0        0 144451161 1 ffff8107051a9840 351 10 0 2 -1

On TCP_SYN_RECV (03) sockets, timer can apparently be elapsed by many 
ticks, while on TCP_ESTABLISHED (01) one, I get
jiffies_to_clock(-1) -> 1AD7F29ABCA value because the way 
get_tcp4_sock() is coded (jiffies can change while running this function).
Note the 00: that means that no timer in my case.

Running again the command one second later gives completely different 
results (other sockets are displayed)

Maybe on 2.6.26-rc3+ we miss some timer correctness or we expose a 
latent NET bug.

void sk_reset_timer(struct sock *sk, struct timer_list* timer,
                    unsigned long expires)
{
        if (!mod_timer(timer, expires))
                sock_hold(sk);
}


Note that arming a timer also increase socket refcount and could explain 
why Ingo have sockets
apparently not owned by a process but still referenced (by a timer or 
many ones (I see refcnt=5) on following snapshots)



Just my initial thoughts, sorry I currently cannot spend much time to 
diagnose the problem.





--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 7:56 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Thu May 29, 7:14 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 7:46 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 8:18 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 8:58 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Sat May 31, 12:35 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Patrick McManus, (Sat May 31, 6:46 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Eric Dumazet, (Sun Jun 1, 2:04 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sun Jun 1, 1:51 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Fri May 30, 5:12 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Thu May 29, 9:48 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Evgeniy Polyakov, (Thu May 29, 9:05 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Peter Zijlstra, (Wed May 28, 5:27 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Sat May 31, 10:25 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 12:09 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Sat May 31, 1:58 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 2:37 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Sat May 31, 4:25 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 5:39 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Tue Jun 3, 8:10 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Wed Jun 4, 7:14 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Wed Jun 4, 10:00 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Wed Jun 4, 11:09 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Fri Jun 6, 5:32 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon Jun 9, 3:24 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Tue Jun 10, 7:26 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Wed Jun 11, 9:39 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Wed Jun 18, 8:30 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Håkon Løvdal, (Sat May 31, 5:45 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Sat May 31, 1:22 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Arjan van de Ven, (Mon May 26, 12:24 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 9:28 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 10:12 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 10:58 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 12:23 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 12:32 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 12:54 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 1:08 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 5:20 pm)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 10:17 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ilpo Järvinen, (Mon May 26, 10:43 am)
Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+, Ingo Molnar, (Mon May 26, 10:29 am)