lkml.org 
[lkml]   [1999]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] Re: setitimer lowlatency-2.2.13-A1 questions
On Mon, 6 Dec 1999, Ingo Molnar wrote:

>--- linux/include/asm-i386/softirq.h.orig Mon Dec 6 19:27:28 1999
>+++ linux/include/asm-i386/softirq.h Mon Dec 6 19:27:58 1999
>@@ -136,6 +136,8 @@
> if (atomic_dec_and_test(&bh_mask_count[nr]))
> bh_mask |= 1 << nr;
> spin_unlock_irqrestore(&i386_bh_lock, flags);
>+ if (bh_mask & bh_active)
>+ do_bottom_half();
> }
>
> #endif /* __ASM_SOFTIRQ_H */

It's not safe as do_bottom_half can return with irq disabled and it's not
safe to reenable the irqs inside enable_bh if enable_bh is be called with
irq disabled. I fixed both problems in this alternate patch (not compiled
too ;):

--- 2.2.14pre11/include/asm-i386/softirq.h Fri Nov 26 20:01:33 1999
+++ /tmp/softirq.h Mon Dec 6 19:30:01 1999
@@ -125,6 +125,14 @@
if (atomic_dec_and_test(&bh_mask_count[nr]))
bh_mask |= 1 << nr;
spin_unlock_irqrestore(&i386_bh_lock, flags);
+
+ /* If there are pending bh and we called this function
+ with irq enabled, run the bhs before returning. */
+ if (get_active_bhs() && (flags & (1 << 9)))
+ {
+ do_bottom_half();
+ __restore_flags(flags);
+ }
}

#endif /* __ASM_SOFTIRQ_H */

Andrea


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.066 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site