[patch] little bhhandler optimization

Andrea Arcangeli (andrea@suse.de)
Thu, 19 Aug 1999 22:03:18 +0200 (CEST)


The object of hardirq_trylock() is to avoid us to run bh handlers if
somebody is spinning in cli() or if we are running in a nested irq handler
(we are not at irq-level zero). But we can run bh handlers even if there
are parallel irqs on other cpus.

Currently instead we don't run any bh handler if some irq handler is just
running in another CPU. This is not necessary since after we started our
first bh handler, then another irq can happen and run parallel with us
anyway.

This patch will do this minor optimization:

--- 2.3.14-pre2/include/asm-i386/hardirq.h.~1~ Thu Aug 19 21:25:33 1999
+++ 2.3.14-pre2/include/asm-i386/hardirq.h Thu Aug 19 21:53:50 1999
@@ -53,7 +53,7 @@

static inline int hardirq_trylock(int cpu)
{
- return !atomic_read(&global_irq_count) && !test_bit(0,&global_irq_lock);
+ return !local_irq_count[cpu] && !test_bit(0,&global_irq_lock);
}

#define hardirq_endlock(cpu) do { } while (0)

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/