linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix kirq code for clustered mode
@ 2003-02-18 17:51 Dave Hansen
  2003-02-20 12:19 ` William Lee Irwin III
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2003-02-18 17:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

The new kirq code breaks clustered apic mode.  This 2-liner fixes it.
It should compile down to the same thing, unless you're using a
clustered apic sub-arch.

-- 
Dave Hansen
haveblue@us.ibm.com

[-- Attachment #2: kirq-apicid-fix-2.5.62-2.patch --]
[-- Type: text/plain, Size: 1016 bytes --]

diff -ru linux-2.5.62-clean/arch/i386/kernel/io_apic.c linux-2.5.62-kirqfix/arch/i386/kernel/io_apic.c
--- linux-2.5.62-clean/arch/i386/kernel/io_apic.c	Mon Feb 17 14:56:10 2003
+++ linux-2.5.62-kirqfix/arch/i386/kernel/io_apic.c	Tue Feb 18 09:44:22 2003
@@ -441,7 +441,7 @@
 		Dprintk("irq = %d moved to cpu = %d\n", selected_irq, min_loaded);
 		/* mark for change destination */
 		spin_lock(&desc->lock);
-		irq_balance_mask[selected_irq] = target_cpu_mask;
+		irq_balance_mask[selected_irq] = cpu_to_logical_apicid(min_loaded);
 		spin_unlock(&desc->lock);
 		/* Since we made a change, come back sooner to 
 		 * check for more variation.
@@ -515,7 +515,7 @@
 	
 	/* push everything to CPU 0 to give us a starting point.  */
 	for (i = 0 ; i < NR_IRQS ; i++)
-		irq_balance_mask[i] = 1 << 0;
+		irq_balance_mask[i] = cpu_to_logical_apicid(0);
 	for (;;) {
 		set_current_state(TASK_INTERRUPTIBLE);
 		time_remaining = schedule_timeout(time_remaining);
Only in linux-2.5.62-kirqfix/arch/i386/kernel: io_apic.c~

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

* Re: [PATCH] fix kirq code for clustered mode
  2003-02-18 17:51 [PATCH] fix kirq code for clustered mode Dave Hansen
@ 2003-02-20 12:19 ` William Lee Irwin III
  2003-02-20 12:29   ` William Lee Irwin III
  0 siblings, 1 reply; 3+ messages in thread
From: William Lee Irwin III @ 2003-02-20 12:19 UTC (permalink / raw)
  To: Dave Hansen; +Cc: linux-kernel

On Tue, Feb 18, 2003 at 09:51:28AM -0800, Dave Hansen wrote:
> The new kirq code breaks clustered apic mode.  This 2-liner fixes it.
> It should compile down to the same thing, unless you're using a
> clustered apic sub-arch.

This isn't quite enough:


static int irq_affinity_write_proc (struct file *file, const char *buffer,
					unsigned long count, void *data)
{
	int irq = (long) data, full_count = count, err;
	unsigned long new_value;

	if (!irq_desc[irq].handler->set_affinity)
		return -EIO;

	err = parse_hex_value(buffer, count, &new_value);

	/*
	 * Do not allow disabling IRQs completely - it's a too easy
	 * way to make the system unusable accidentally :-) At least
	 * one online CPU still has to be targeted.
	 */
	if (!(new_value & cpu_online_map))
		return -EINVAL;

	irq_affinity[irq] = new_value;
	irq_desc[irq].handler->set_affinity(irq, new_value);

	return full_count;
}

This is a bitmask and it's being handed directly to set_ioapic_affinity().
Or, at least, it's inconsistent, being &'d with cpu_online_map.


-- wli

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

* Re: [PATCH] fix kirq code for clustered mode
  2003-02-20 12:19 ` William Lee Irwin III
@ 2003-02-20 12:29   ` William Lee Irwin III
  0 siblings, 0 replies; 3+ messages in thread
From: William Lee Irwin III @ 2003-02-20 12:29 UTC (permalink / raw)
  To: Dave Hansen, linux-kernel

On Tue, Feb 18, 2003 at 09:51:28AM -0800, Dave Hansen wrote:
>> The new kirq code breaks clustered apic mode.  This 2-liner fixes it.
>> It should compile down to the same thing, unless you're using a
>> clustered apic sub-arch.

On Thu, Feb 20, 2003 at 04:19:17AM -0800, William Lee Irwin III wrote:
> This isn't quite enough:

Also, even with your patch, I get:

Uhhuh. NMI received for unknown reason 25 on CPU 3.
Uhhuh. NMI received for unknown reason 35 on CPU 2.
Dazed and confused, but trying to continue
...

Hmm... something is going seriously wrong here. I suspect someone
is clobbering my RTE's even though no_irq_balance is #defined to 1.
Or, worse yet, NMI interrupt gate boogie is going seriously wrong.


-- wli

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

end of thread, other threads:[~2003-02-20 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-18 17:51 [PATCH] fix kirq code for clustered mode Dave Hansen
2003-02-20 12:19 ` William Lee Irwin III
2003-02-20 12:29   ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).