Received: by oss.sgi.com id ; Tue, 30 May 2000 19:36:39 -0700 Received: from smtprch1.nortelnetworks.com ([192.135.215.14]:9354 "EHLO smtprch1.nortel.com") by oss.sgi.com with ESMTP id ; Tue, 30 May 2000 19:36:07 -0700 Received: from zrchb213.us.nortel.com (actually zrchb213) by smtprch1.nortel.com; Tue, 30 May 2000 21:29:39 -0500 Received: from zctwb003.asiapac.nortel.com ([47.152.32.111]) by zrchb213.us.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id LW2B0SVH; Tue, 30 May 2000 21:28:42 -0500 Received: from pwold011.asiapac.nortel.com ([47.181.193.45]) by zctwb003.asiapac.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id LT9PT9R8; Wed, 31 May 2000 12:28:53 +1000 Received: from uow.edu.au (IDENT:akpm@localhost [127.0.0.1]) by pwold011.asiapac.nortel.com (8.9.3/8.9.3) with ESMTP id MAA18926; Wed, 31 May 2000 12:28:39 +1000 Message-ID: <393478D7.7D131923@uow.edu.au> Date: Wed, 31 May 2000 02:28:39 +0000 X-Sybari-Space: 00000000 00000000 00000000 From: Andrew Morton X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.3.99-pre5 i686) X-Accept-Language: en MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru CC: netdev@oss.sgi.com Subject: Re: [timers] net/ipv4 References: <3933B0B2.50AB5EA1@uow.edu.au> from "Andrew Morton" at May 30, 0 10:14:42 pm <200005301659.UAA12445@ms2.inr.ac.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-netdev@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;netdev-outgoing Alexey, I'm obviously missing something. If you want to say "Andrew, TCP is safe" then that's cool. I'll just buzz off and stare unhappily at the SCSI code. But I just need one more shot at it. :) kuznet@ms2.inr.ac.ru wrote: > > Even not counting that del_timer_sync is deadlocky, > it should not be ever used for static timers, static struct timer_list timer; int foo; handler() { foo = 1; } mainline() { del_timer_async(&timer); foo = 2; } That is a race. So why do you say del_timer_sync() is not needed for static timers? > > Of course. I repeat again and again, TCP use _reference_ _counting_. Bear with me Alexey, I'm Australian. Where are the refcounts held? Let's look at igmp.c: static __inline__ void igmp_stop_timer(struct ip_mc_list *im) { // igmp_timer_expire() could be running right now spin_lock_bh(&im->lock); // and now if (del_timer(&im->timer)) atomic_dec(&im->refcnt); im->tm_running=0; im->reporter = 0; // and now. im->unsolicit_count = 0; spin_unlock_bh(&im->lock); } static void igmp_timer_expire(unsigned long data) { ... // Race here. im->reporter = 1; ip_ma_put(im); } I assume there is SOMETHING at a higher layer which prevents this occurring. But what?