Re: [PATCH] Use msleep_interruptible for therm_adt7467.c kernelthread

From: Benjamin Herrenschmidt
Date: Tue Sep 28 2004 - 23:17:37 EST


On Wed, 2004-09-29 at 11:24, Alan Cox wrote:
> On Mer, 2004-09-29 at 02:58, Herbert Xu wrote:
> > > A more interesting question is why this isn't being driven off a
> > > timer ?
> >
> > It probably could if the stuff afterwards doesn't sleep.
>
> schedule_work() ?

I don't like that. I wrote the g5 therm driver (from which this one is
derivated) as a kernel thread because, at least on the g5, I do a lot of
i2c accesses. If I were to do that in schedule_work, I would "hog" keventd
a very long time each time, which is bad.

schedule_work() is always way too much abused in this way, thus beeing
a source of latencies.

Creating my own work queue would have been silly since (at least back
then), it would have meant creating one additional kernel thread on every
CPU... so I decided just to create my own kernel thread and be done with
it.

Now, using a timer and waiting on it would eventually work too, but the
way it is now just works so ...

Ben.


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