public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] irqlock patch 2.5.27-H4
@ 2002-07-24 11:47 Ingo Molnar
  2002-07-24 11:59 ` Christoph Hellwig
  2002-07-24 13:13 ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 9+ messages in thread
From: Ingo Molnar @ 2002-07-24 11:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds


the latest irqlock patch can be found at:

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

Changes in -H4:

 - fix the cli()/sti() hack in ide/main.c, per Marcin Dalecki's
   suggestion. [this leaves the tty layer as the only remaining subsystem
   that still has cli()/sti() related hacks.]

Changes in -H3:

 - init thread needs to have preempt_count of 1 until sched_init(). 
   (William Lee Irwin III)

 - clean up the irq-mask macros. (Linus)

 - add barrier() to irq_enter() and irq_exit(). (based on Oleg Nesterov's
   comment.)

 - move the irqs-off check into preempt_schedule() and remove
   CONFIG_DEBUG_IRQ_SCHEDULE.

Changes in -G5:

 - remove spin_unlock_no_resched() and comment the affected places more
   agressively.

Changes in -G3:

 - slab.c needs to spin_unlock_no_resched(), instead of spin_unlock(). (It
   also has to check for preemption in the right spot.) This should fix
   the memory corruption.

 - irq_exit() needs to run softirqs if interrupts not active - in the 
   previous patch it ran them when preempt_count() was 0, which is
   incorrect.

 - spinlock macros are updated to enable preemption after enabling 
   interrupts. Besides avoiding false positive warnings, this also 

 - fork.c has to call scheduler_tick() with preemption disabled - 
   otherwise scheduler_tick()'s spin_unlock can preempt!

 - irqs_disabled() macro introduced.

 - [ all other local_irq_enable() or sti instances conditional on
     CONFIG_DEBUG_IRQ_SCHEDULE are to fix false positive warnings. ]

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] 9+ messages in thread
* Re: [patch] irqlock patch 2.5.27-H4
@ 2002-07-26  4:45 Oleg Nesterov
  0 siblings, 0 replies; 9+ messages in thread
From: Oleg Nesterov @ 2002-07-26  4:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar

Hello.

arch/i386/kernel/microcode.c:do_microcode_update() calls
smp_call_function(do_update_one). do_update_one() does
spin_lock/unlock. So smp_call_function_interrupt() needs
irq_enter().

entry.S has unneeded GET_THREAD_INFO(%ebx) in
device_not_available() trap.

Patch against 2.5.28.

--- arch/i386/kernel/smp.c~	Fri Jul 26 07:49:03 2002
+++ arch/i386/kernel/smp.c	Fri Jul 26 07:53:45 2002
@@ -646,7 +646,10 @@
 	/*
 	 * At this point the info structure may be out of scope unless wait==1
 	 */
+	irq_enter();
 	(*func)(info);
+	irq_exit();
+
 	if (wait) {
 		mb();
 		atomic_inc(&call_data->finished);
--- arch/i386/kernel/entry.S~	Fri Jul 26 07:49:03 2002
+++ arch/i386/kernel/entry.S	Fri Jul 26 07:57:48 2002
@@ -417,7 +417,6 @@
 ENTRY(device_not_available)
 	pushl $-1			# mark this as an int
 	SAVE_ALL
-	GET_THREAD_INFO(%ebx)
 	movl %cr0, %eax
 	testl $0x4, %eax		# EM (math emulation bit)
 	jne device_not_available_emulate

Oleg.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [patch] irqlock patch 2.5.27-H4
@ 2002-07-26  5:51 Oleg Nesterov
  0 siblings, 0 replies; 9+ messages in thread
From: Oleg Nesterov @ 2002-07-26  5:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar

Hello.

Oleg Nesterov wrote:
> +       irq_enter();
>         (*func)(info);
> +       irq_exit();

It is better to update call_data->finished before
doing soft irqs in irq_exit().

Against 2.5.28:

--- arch/i386/kernel/smp.c~	Fri Jul 26 07:49:03 2002
+++ arch/i386/kernel/smp.c	Fri Jul 26 09:29:20 2002
@@ -646,10 +646,12 @@
 	/*
 	 * At this point the info structure may be out of scope unless wait==1
 	 */
+	irq_enter();
 	(*func)(info);
 	if (wait) {
 		mb();
 		atomic_inc(&call_data->finished);
 	}
+	irq_exit();
 }
 
--- arch/i386/kernel/entry.S~	Fri Jul 26 07:49:03 2002
+++ arch/i386/kernel/entry.S	Fri Jul 26 07:57:48 2002
@@ -417,7 +417,6 @@
 ENTRY(device_not_available)
 	pushl $-1			# mark this as an int
 	SAVE_ALL
-	GET_THREAD_INFO(%ebx)
 	movl %cr0, %eax
 	testl $0x4, %eax		# EM (math emulation bit)
 	jne device_not_available_emulate


Oleg.

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

end of thread, other threads:[~2002-07-26  5:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-24 11:47 [patch] irqlock patch 2.5.27-H4 Ingo Molnar
2002-07-24 11:59 ` Christoph Hellwig
2002-07-24 12:08   ` Ingo Molnar
2002-07-24 19:57     ` george anzinger
2002-07-24 13:13 ` Bartlomiej Zolnierkiewicz
2002-07-24 13:13   ` Marcin Dalecki
2002-07-24 13:23     ` Bartlomiej Zolnierkiewicz
  -- strict thread matches above, loose matches on Subject: below --
2002-07-26  4:45 Oleg Nesterov
2002-07-26  5:51 Oleg Nesterov

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