Re: [PATCH 2/2] ne.c msleep not mdelay

From: David Fries
Date: Sat Aug 30 2008 - 10:58:22 EST


On Sat, Aug 30, 2008 at 11:36:47PM +0900, Atsushi Nemoto wrote:
> On Sat, 30 Aug 2008 09:59:06 +0100, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> > > mdelay(10) replaced by msleep(10) to give up the CPU, it's just
> > > waiting for an interrupt, so timing isn't critical.
> >
> > It is too critical for a reschedule to occur.
> >
> > NAK this one.
>
> There are already some msleep() in probe_irq_on() which is called just
> before here. And this part is not protected by any spinlock or
> preempt_disable.

There is a probing_active mutex. probe_irq_off has the comment
"nothing prevents two IRQ probe callers from overlapping." Looks to me
like probing_active would prevent multiple probes from happening.

> So, if rescheduling was dangerous here, we already have potential
> problems, no?

I was just going to make the argument that any task that could be run
during msleep, could just as easily run on the other cpu in mdelay (if
there was one).

--
David Fries <david@xxxxxxxxx>
http://fries.net/~david/ (PGP encryption key available)
--
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/