From: Andrew Morton <akpm@zip.com.au>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [patch] scalable timers implementation, 2.4.16, 2.5.0
Date: Wed, 05 Dec 2001 20:20:28 -0800 [thread overview]
Message-ID: <3C0EF20C.36449AAB@zip.com.au> (raw)
In-Reply-To: Your message of "Wed, 05 Dec 2001 14:13:17 -0800." <3C0E9BFD.BC189E17@zip.com.au> <E16Bo4c-00031f-00@wagner>
Rusty Russell wrote:
>
> In message <3C0E9BFD.BC189E17@zip.com.au> you write:
> > Rusty Russell wrote:
> > >
> > > PS. Also would be nice to #define del_timer del_timer_sync, and have a
> > > del_timer_async for those (very few) cases who really want this.
> >
> > That could cause very subtle deadlocks. I'd prefer to do:
> >
> > #define del_timer_async del_timer
>
> I'd prefer to audit them all, create a patch, and remove del_timer.
> Doing it slowly usually means things just get forgotten, then hacked
> around when it finally gets ripped out.
um. Auditing them all is a big task:
akpm-1:/usr/src/linux-2.4.17-pre4> grep -r del_timer . | wc
800 2064 48299
akpm-1:/usr/src/linux-2.4.17-pre4> grep -r del_timer_sync . | wc
85 245 5384
I tried it, when I was a young man.
One mindset would be to just replace all the del_timer calls
with del_timer_sync by default, and to then look for the below
deadlock pattern. But if you do this, Alexey shouts at you,
because his code actually gets del_timer right, by looking at
its return value.
I'd urge you to reconsider. We have a *lot* of timer deletion
races in Linux, and squashing them all in one patch just isn't
feasible.
> The deadlock you're referring to is, I assume, del_timer_sync() called
> inside the timer itself? Can you think of any other dangerous cases?
Nope. The deadlock is where the caller of del_timer_sync holds
some lock which would prevent the completion of the timer handler.
It happens, and is sometimes subtle.
drivers/video/txfxfb.c is an unsubtle example.
-
next prev parent reply other threads:[~2001-12-06 4:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-27 14:57 [patch] scalable timers implementation, 2.4.16, 2.5.0 Ingo Molnar
2001-12-05 21:29 ` Rusty Russell
2001-12-05 22:13 ` Andrew Morton
2001-12-06 2:15 ` Rusty Russell
2001-12-06 4:20 ` Andrew Morton [this message]
2001-12-06 9:10 ` Alan Cox
2001-12-06 10:41 ` Ingo Molnar
[not found] <3C0E9BFD.BC189E17@zip.com.au.suse.lists.linux.kernel>
[not found] ` <E16Bo4c-00031f-00@wagner.suse.lists.linux.kernel>
2001-12-06 2:32 ` Andi Kleen
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=3C0EF20C.36449AAB@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
/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