Re: arca-1-against-pre-2.1.127-3

Kenneth Albanowski (kjahds@kjahds.com)
Mon, 2 Nov 1998 15:22:11 -0500 (EST)


On Mon, 2 Nov 1998, Finn Arne Gangstad wrote:

> On Mon, 2 Nov 1998, Kenneth Albanowski wrote:
>
> > On Mon, 2 Nov 1998, Andrea Arcangeli wrote:
> >
> > > On Mon, 2 Nov 1998, Gerard Roudier wrote:
> > >
> > > >Here is the bug report:
> > >
> > > I just put out a new arca-6 with a more high level (and fixed) approch to
> > > check if the timer is pending.
> >
> > On a related topic, back in 2.0.x, I've felt the lack of an atomic "start
> > timer with given time if not running. If already running, don't touch it"
> > function. A function that does this reliably (even with interrupts on)
> > would be appreciated.
>
> This should do the trick, but is maybe slightly ugly:
>
> if (!del_timer(timer)) {
> /* It wasn't running, give it a good expires value */
> timer->expires = whenever;
> }
> add_timer(timer);

Yes, but my point is that it should be a primitive: if we are going around
fixing up misuses of the timer code, we should also look at making it
simpler to use the facility properly. Primitives that do work for you are
an important part of that.

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)

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