public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@innominate.de>
To: Rusty@innominate.de, Russell@innominate.de, linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE] Kernel Janitor's TODO list
Date: Tue, 30 Jan 2001 18:49:32 +0100	[thread overview]
Message-ID: <3A76FEAC.878B1FAF@innominate.de> (raw)
In-Reply-To: <3A74451F.DA29FD17@uow.edu.au> <E14NPEr-0005LR-00@halfway> <3A76A35F.6CD57281@innominate.de>

Daniel Phillips wrote:
> 
> Rusty Russell wrote:
> >
> > In message <3A74451F.DA29FD17@uow.edu.au> you write:
> > >       http://www.uwsg.iu.edu/hypermail/linux/kernel/0005.3/0269.html
> > >
> > > A lot of the timer deletion races are hard to fix because of
> > > the deadlock problem.
> >
> > Hmmm...
> >
> >         For 2.5, changing the timer interface to disallow mod_timer or
> > add_timer (equivalent) on self, and making the timerfn return num
> > jiffies to next run (0 = don't rerun) would solve this, right?
> > I don't see a maintainable way of solving this otherwise,
> 
> It seems silly not to provide direct support for such a simple, useful
> mechanism as a periodic timer.  This can be accomplished easily by
> adding a field 'periodic' to struct timer_list.  If 'periodic' is
> non-zero then run_timer_list uses it to set the 'expires' field and
> re-inserts the timer.
> 
> For what it's worth, this is backward compatible with the existing
> strategy.  The timer_list->function is still in complete control of
> things if it wants to be, but forbidding it from re-adding itself sounds
> like an awfully good idea.

Whoops, this post from Alexy makes it quite clear why I can't do that:

	http://www.wcug.wwu.edu/lists/netdev/200005/msg00050.html
	Timers are self-destructable as rule. See? Normal usage
	for timer is to have it allocated inside an object and
	timer event detroys the object together with timer.

I did a quick scan through timer usage, and sure enough, I found
self-destructive behaviour as Alexy describes, for example, in
ax25_std_heartbeat_expiry.  Your suggestion is good and simple, but
requires every timer_list->function to be changed, a couple of hundred
places to check.

It would be nice to have a nice easy transition instead of a
jump-off-the-cliff and change all usage approach.  Hmm, a hack is
coming... I'll add a new, improved function field beside the old one,
call it ->timer_event, and it can force rescheduling as you suggested. 
If ->timer_event is non-null it gets called instead of ->function, and
the timer may be requeued.  For good measure, I'll leave my ->period
field in there because it just makes sense.  Then I can write a generic
->timer_event that just returns the ->period.

/me: hack, hack, hack

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-30 17:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-27 17:11 [ANNOUNCE] Kernel Janitor's TODO list Arnaldo Carvalho de Melo
2001-01-28 15:20 ` David Woodhouse
2001-01-28 14:03   ` Arnaldo Carvalho de Melo
2001-01-28 15:49   ` Michael H. Warfield
2001-01-28 16:13 ` Andrew Morton
2001-01-28 14:28   ` Arnaldo Carvalho de Melo
2001-01-28 14:33     ` Arnaldo Carvalho de Melo
2001-01-30  1:05   ` Rusty Russell
2001-01-30 11:19     ` Daniel Phillips
2001-01-30 17:49       ` Daniel Phillips [this message]
2001-01-30 19:37     ` [RFC] New Improved Stronger Whiter Timers (was: Kernel Janitor) Daniel Phillips
2001-01-30 21:22       ` Daniel Phillips
  -- strict thread matches above, loose matches on Subject: below --
2001-01-28 16:14 [ANNOUNCE] Kernel Janitor's TODO list Manfred Spraul
2001-01-28 14:36 ` Arnaldo Carvalho de Melo
2001-01-28 16:45   ` Manfred Spraul
2001-01-28 17:07     ` David Woodhouse
2001-01-28 17:40       ` Manfred Spraul
2001-01-28 18:51         ` Roman Zippel
2001-01-29 17:01         ` Timur Tabi
2001-01-29 17:10           ` John Levon
2001-01-29 18:27             ` David D.W. Downey
2001-01-29 20:44               ` davej
2001-01-29 20:51               ` Timur Tabi
2001-01-29 20:56                 ` Rasmus Andersen
2001-01-30  0:29                 ` Peter Samuelson
2001-01-30  0:20               ` Ingo Oeser
2001-01-30 11:11               ` David Woodhouse
2001-01-30 16:52               ` Timur Tabi
2001-01-31  0:06                 ` Daniel Phillips
2001-01-31  0:09                 ` Timur Tabi
2001-01-31  9:14                   ` David Woodhouse
2001-01-30 17:10               ` David Woodhouse
2001-01-29 17:26           ` Andi Kleen
2001-01-29 19:47             ` Roman Zippel
2001-01-29 20:35               ` Andi Kleen
2001-02-16 14:29                 ` Andrea Arcangeli
2001-02-16 14:26               ` Andrea Arcangeli
2001-01-31 17:57         ` Alan Cox
2001-01-31 19:15           ` Manfred Spraul
2001-01-30  1:22 Rusty Russell
2001-01-30  3:08 ` Andrew Morton

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=3A76FEAC.878B1FAF@innominate.de \
    --to=phillips@innominate.de \
    --cc=Russell@innominate.de \
    --cc=Rusty@innominate.de \
    --cc=linux-kernel@vger.kernel.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