2003-06-18 00:10:34

by Robert Love

[permalink] [raw]
Subject: Re: [PATCH] 2.4 preemption bug in bh_kmap_irq

On Mon, 2003-04-14 at 10:27, Joe Korty wrote:

> The bug is that bh_map_irq *conditionally* calls kmap_atomic (which
> disables preemption as one of its functions), while bh_unmap_irq
> *unconditionally* calls kunmap_atomic (which enables it). This
> imbalance results in a occasional off-by-one preempt_count, which in
> turn causes IDE PIO mode interrupt code (specifically, read_intr) to
> erronously invoke preempt_schedule while at interrupt level.

Thanks for this (and sorry for the very delayed reply).

I am going to put this in the 2.4.21 preempt-kernel patch, because
actually someone else here at MontaVista fixed the problem in the same
exact way a loooong time ago and it seems to work.

I agree it is suboptimal and I will be happy to take patches from
someone else with a better idea. Until then, simplicity rules. Thanks.

Robert Love



2003-06-19 12:06:46

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] 2.4 preemption bug in bh_kmap_irq

On Tue, Jun 17 2003, Robert Love wrote:
> On Mon, 2003-04-14 at 10:27, Joe Korty wrote:
>
> > The bug is that bh_map_irq *conditionally* calls kmap_atomic (which
> > disables preemption as one of its functions), while bh_unmap_irq
> > *unconditionally* calls kunmap_atomic (which enables it). This
> > imbalance results in a occasional off-by-one preempt_count, which in
> > turn causes IDE PIO mode interrupt code (specifically, read_intr) to
> > erronously invoke preempt_schedule while at interrupt level.
>
> Thanks for this (and sorry for the very delayed reply).
>
> I am going to put this in the 2.4.21 preempt-kernel patch, because
> actually someone else here at MontaVista fixed the problem in the same
> exact way a loooong time ago and it seems to work.
>
> I agree it is suboptimal and I will be happy to take patches from
> someone else with a better idea. Until then, simplicity rules. Thanks.

See 2.5 for the right fix.

--
Jens Axboe