public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups.
@ 2002-07-20 17:57 Oleg Nesterov
  2002-07-21 23:43 ` george anzinger
  0 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2002-07-20 17:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar

Hello.

> - to remove the preemption count increase/decrease code from the lowlevel
>   IRQ assembly code.

So do_IRQ() can start with preempt_count == 0.
Suppose another cpu sets TIF_NEED_RESCHED flag
at the same time.

spin_lock(&desc->lock) sets preempt_count == 1.
Before calling handle_IRQ_event() (which adds IRQ_OFFSET
to preempt_count), do_IRQ() does spin_unlock(&desc->lock)
and falls into schedule().

Am I missed something?

It seems to me that call to irq_enter() must be shifted
from handle_IRQ_event() to do_IRQ().

Oleg.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups.
@ 2002-07-20 20:54 Ingo Molnar
  2002-07-19 21:49 ` george anzinger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ingo Molnar @ 2002-07-20 20:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds, Russell King, David S. Miller


the following patch, against 2.5.26:

  http://redhat.com/~mingo/remove-irqlock-patches/remove-irqlock-2.5.26-A2

is a work-in-progress massive cleanup of the IRQ subsystem. It's losely
based on Linus' original idea and DaveM's original implementation, to fold
our various irq, softirq and bh counters into the preemption counter.

with this approach it was possible:

 - to remove the 'big IRQ lock' on SMP - on which sti() and cli() relied.

 - to streamline/simplify arch/i386/kernel/irq.c significantly.

 - to simplify the softirq code.

 - to remove the preemption count increase/decrease code from the lowlevel
   IRQ assembly code.

 - to speed up schedule() a bit.

sti() and cli() is gone forever, there is no more globally synchronizing
irq-disabling capability. All code that relied on sti() and cli() and
restore_flags() must use other locking mechanisms from now on (spinlocks
and __cli()/__sti()).

obviously this patch breaks massive amounts of code, so only limited
.configs are working at the moment, such as:

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

otherwise the patch was developed and tested on SMP systems, and while the
code is still a bit rough in places, the base IRQ code appears to be
pretty robust and clean.

while it boots already so the worst is over, there is lots of work left:
eg. to fix the serial layer to not use cli()/sti() and bhs ...

RMK, is there any chance to get your new serial layer into 2.5 sometime
soon? ['soon' as in 'tomorrow' :-) ] That is perhaps one of the biggest
kernel subsystems that make use of cli()/sti() currently. The rest is
drivers mostly, which is still not unsignificant, but perhaps a bit easier
to manage.

	Ingo


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups.
@ 2002-07-22 14:45 Oleg Nesterov
  2002-07-22 18:03 ` george anzinger
  0 siblings, 1 reply; 11+ messages in thread
From: Oleg Nesterov @ 2002-07-22 14:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, george anzinger

Hello.

> > [...] To do this from irq.c means that it must exit with interrupts off
> > and the the low level code needs to keep them off till the irtn. [...]

> yes, we are very careful to keep irqs disabled in do_IRQ(), both before
> and after calling the handler.

Note that smp_xxx_interrupt() functions must be carefull
with preemt_{disable,enable} brackets.

For example, smp_invalidate_interrupt() may be preempted
after put_cpu(). Probably not big deal (it is return path),
but it is better to use preempt_enable_no_resched() here -
let ret_from_intr: do its job.

smp_{error,spurious,thermal}_interrupt() - all of them
use printk() without bumping preemt_count and have problem
after spin_unlock_irqrestore(&logbuf_lock, flags).

If these problems worth fixing, then preempt_stop (cli)
can be killed in entry.S:ret_from_intr(), yes? If i understand
correctly none of the irq handlers should return to low level
code with irq enabled.

P.S.

May I suggest somebody with good english fix
Documentation/preempt-locking.txt?
It states, that disabled interrupts prevents preemption.
Yes, but only in a sense, that the delivery of reschedule
interrupt is suppressed.

Process with irqs disabled and current->preempt_count == 0 can
be preempted (with interrupts enabled) after spin_lock/unlock etc.
Even in UP case preemption can happen while calling wake_up_...().

Oleg.

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

end of thread, other threads:[~2002-07-22 18:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-20 17:57 [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups Oleg Nesterov
2002-07-21 23:43 ` george anzinger
2002-07-21 23:50   ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2002-07-20 20:54 Ingo Molnar
2002-07-19 21:49 ` george anzinger
2002-07-20 14:25 ` Marcin Dalecki
2002-07-21 21:17   ` Ingo Molnar
2002-07-20 20:57 ` Ingo Molnar
2002-07-22 14:45 Oleg Nesterov
2002-07-22 18:03 ` george anzinger
2002-07-22 18:04   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox