All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] big IRQ lock removal, 2.5.27-G0
@ 2002-07-23 23:40 Oleg Nesterov
  2002-07-23 23:50 ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Nesterov @ 2002-07-23 23:40 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

Hello.

I can't understand the preempt_count() check in irq_exit()
and local_bh_enable(). Did you meant irq_count() instead?
I beleive preempt_disable() should not disable soft interrupts.

In local_bh_enable() it is probably unneeded at all, because
nested local_bh_disable() is rare (i think), and do_softirq()
checks in_interrupt().

Now suppose preempt_count() & PREEMPT_MASK == 0.

Then local_bh_enable() has a small preemptible window between
__local_bh_enable() and do_softirq()->local_irq_save(flags).
It is only latency problem.

But in irq_exit() case interrupt context may be preempted
while doing wakeup_softirqd(cpu) after __local_bh_enable()
in do_softirq().

So i suggest something like this pseudo code:

__preempt_hack(offset)
{
        barrier();
        preempt_count() -= offset
#ifdef  CONFIG_PREEMPT
                        - 1
#endif
        ;
}

irq_exit()
{
        __preempt_hack(HARDIRQ_OFFSET);
        if (unlikely(!irq_count() &&
                        softirq_pending(smp_processor_id())))
                do_softirq();
        preempt_enable_no_resched();
}

local_bh_enable()
{
        __preempt_hack(SOFTIRQ_OFFSET);
        if (unlikely(!irq_count() &&
                        softirq_pending(smp_processor_id())))
                do_softirq();
        preempt_enable();
}

Or just add extra preempt_disable() in both functions to kill
terrible __preempt_hack().

Sorry, i have no remove-irqlock patches applied, so can't
suggest diff.

Oleg.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [patch] big IRQ lock removal, 2.5.27-G0
@ 2002-07-23 16:26 Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2002-07-23 16:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds


the -G0 irqlock patch can be found at:

   http://redhat.com/~mingo/remove-irqlock-patches/remove-irqlock-2.5.27-G0

Changes in -G0:

 - fix buggy in_softirq(). Fortunately the bug made the test broader,
   which didnt result in algorithmical breakage, just suboptimal
   performance.

 - move do_softirq() processing into irq_exit() => this also fixes the
   softirq processing bugs present in apic.c IRQ handlers that did not
   test for softirqs after irq_exit().

 - simplify local_bh_enable().

Changes in -F9:

 - replace all instances of:

	local_save_flags(flags);
	local_irq_disable();

   with the shorter form of:

	local_irq_save(flags);

  about 30 files are affected by this change.

Changes in -F8:

 - preempt/hardirq/softirq count separation, cleanups.

 - skbuff.c fix.

 - use irq_count() in scheduler_tick()

Changes in -F3:

 - the entry.S cleanups/speedups by Oleg Nesterov.

 - a rather critical synchronize_irq() bugfix: if a driver frees an 
   interrupt that is still being probed then synchronize_irq() locks up.
   This bug has caused a spurious boot-lockup on one of my testsystems,
   ifconfig would lock up trying to close eth0.

 - remove duplicate definitions from asm-i386/system.h, this fixes 
   compiler warnings.

	Ingo



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-07-24  7:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-23 23:40 [patch] big IRQ lock removal, 2.5.27-G0 Oleg Nesterov
2002-07-23 23:50 ` Ingo Molnar
2002-07-23 23:54   ` Ingo Molnar
2002-07-24  1:00   ` Oleg Nesterov
2002-07-24  7:19     ` Ingo Molnar
2002-07-24  3:07   ` Oleg Nesterov
  -- strict thread matches above, loose matches on Subject: below --
2002-07-23 16:26 Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.