From: Ashok Raj <ashok.raj@intel.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, davidm@hpl.hp.com, pj@sgi.com,
linux-ia64@vger.kernel.org, rusty@rustycorp.com.au
Subject: take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [4/7]
Date: Tue, 04 May 2004 14:45:35 +0000 [thread overview]
Message-ID: <20040504074535.D1909@unix-os.sc.intel.com> (raw)
In-Reply-To: <20040429092107.A29687@unix-os.sc.intel.com>
Name: ia64_irq_affinity_fix.patch
Author: Ashok Raj (Intel Corporation)
Status: Tested with Hotplug CPU Code
D: irq affinity setting via /proc was forcing iosapic rte programming
D: by force. The correct way to do this is to perform this when a interrupt
D: is pending.
---
linux-2.6.5-lhcs-root/arch/ia64/kernel/iosapic.c | 19 +++++++++++++++++++
linux-2.6.5-lhcs-root/arch/ia64/kernel/irq.c | 12 +++++++++---
2 files changed, 28 insertions(+), 3 deletions(-)
diff -puN arch/ia64/kernel/irq.c~ia64_irq_affinity_fix arch/ia64/kernel/irq.c
--- linux-2.6.5-lhcs/arch/ia64/kernel/irq.c~ia64_irq_affinity_fix 2004-05-03 16:30:29.805729399 -0700
+++ linux-2.6.5-lhcs-root/arch/ia64/kernel/irq.c 2004-05-03 16:30:29.809635651 -0700
@@ -46,7 +46,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
-
+extern cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
/*
* Linux has a controller-independent x86 interrupt architecture.
@@ -938,7 +938,9 @@ void set_irq_affinity_info (unsigned int
static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
+ int len = sprintf(page, "%s", irq_redir[(long)data] ? "r " : "");
+
+ len += cpumask_scnprintf(page+len, count, irq_affinity[(long)data]);
if (count - len < 2)
return -EINVAL;
len += sprintf(page + len, "\n");
@@ -956,6 +958,7 @@ static int irq_affinity_write_proc (stru
int rlen;
int prelen;
irq_desc_t *desc = irq_descp(irq);
+ unsigned long flags;
if (!desc->handler->set_affinity)
return -EIO;
@@ -994,7 +997,10 @@ static int irq_affinity_write_proc (stru
if (cpus_empty(tmp))
return -EINVAL;
- desc->handler->set_affinity(irq, new_value);
+ spin_lock_irqsave(&desc->lock, flags);
+ pending_irq_cpumask[irq] = new_value;
+ spin_unlock_irqrestore(&desc->lock, flags);
+
return full_count;
}
diff -puN arch/ia64/kernel/iosapic.c~ia64_irq_affinity_fix arch/ia64/kernel/iosapic.c
--- linux-2.6.5-lhcs/arch/ia64/kernel/iosapic.c~ia64_irq_affinity_fix 2004-05-03 16:30:29.807682525 -0700
+++ linux-2.6.5-lhcs-root/arch/ia64/kernel/iosapic.c 2004-05-03 16:30:29.810612214 -0700
@@ -98,6 +98,7 @@
#endif
static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED;
+cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
/* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */
@@ -327,6 +328,21 @@ iosapic_set_affinity (unsigned int irq,
#endif
}
+static inline void move_irq(int irq)
+{
+ /* note - we hold desc->lock */
+ cpumask_t tmp;
+ irq_desc_t *desc = irq_descp(irq);
+
+ if (!cpus_empty(pending_irq_cpumask[irq])) {
+ cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
+ if (unlikely(!cpus_empty(tmp))) {
+ desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
+ }
+ cpus_clear(pending_irq_cpumask[irq]);
+ }
+}
+
/*
* Handlers for level-triggered interrupts.
*/
@@ -343,6 +359,7 @@ iosapic_end_level_irq (unsigned int irq)
{
ia64_vector vec = irq_to_vector(irq);
+ move_irq(irq);
writel(vec, iosapic_intr_info[vec].addr + IOSAPIC_EOI);
}
@@ -382,6 +399,8 @@ static void
iosapic_ack_edge_irq (unsigned int irq)
{
irq_desc_t *idesc = irq_descp(irq);
+
+ move_irq(irq);
/*
* Once we have recorded IRQ_PENDING already, we can mask the
* interrupt for real. This prevents IRQ storms from unhandled
_
WARNING: multiple messages have this Message-ID (diff)
From: Ashok Raj <ashok.raj@intel.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, davidm@hpl.hp.com, pj@sgi.com,
linux-ia64@vger.kernel.org, rusty@rustycorp.com.au
Subject: take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [4/7]
Date: Tue, 4 May 2004 07:45:35 -0700 [thread overview]
Message-ID: <20040504074535.D1909@unix-os.sc.intel.com> (raw)
Name: ia64_irq_affinity_fix.patch
Author: Ashok Raj (Intel Corporation)
Status: Tested with Hotplug CPU Code
D: irq affinity setting via /proc was forcing iosapic rte programming
D: by force. The correct way to do this is to perform this when a interrupt
D: is pending.
---
linux-2.6.5-lhcs-root/arch/ia64/kernel/iosapic.c | 19 +++++++++++++++++++
linux-2.6.5-lhcs-root/arch/ia64/kernel/irq.c | 12 +++++++++---
2 files changed, 28 insertions(+), 3 deletions(-)
diff -puN arch/ia64/kernel/irq.c~ia64_irq_affinity_fix arch/ia64/kernel/irq.c
--- linux-2.6.5-lhcs/arch/ia64/kernel/irq.c~ia64_irq_affinity_fix 2004-05-03 16:30:29.805729399 -0700
+++ linux-2.6.5-lhcs-root/arch/ia64/kernel/irq.c 2004-05-03 16:30:29.809635651 -0700
@@ -46,7 +46,7 @@
#include <asm/delay.h>
#include <asm/irq.h>
-
+extern cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
/*
* Linux has a controller-independent x86 interrupt architecture.
@@ -938,7 +938,9 @@ void set_irq_affinity_info (unsigned int
static int irq_affinity_read_proc (char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
+ int len = sprintf(page, "%s", irq_redir[(long)data] ? "r " : "");
+
+ len += cpumask_scnprintf(page+len, count, irq_affinity[(long)data]);
if (count - len < 2)
return -EINVAL;
len += sprintf(page + len, "\n");
@@ -956,6 +958,7 @@ static int irq_affinity_write_proc (stru
int rlen;
int prelen;
irq_desc_t *desc = irq_descp(irq);
+ unsigned long flags;
if (!desc->handler->set_affinity)
return -EIO;
@@ -994,7 +997,10 @@ static int irq_affinity_write_proc (stru
if (cpus_empty(tmp))
return -EINVAL;
- desc->handler->set_affinity(irq, new_value);
+ spin_lock_irqsave(&desc->lock, flags);
+ pending_irq_cpumask[irq] = new_value;
+ spin_unlock_irqrestore(&desc->lock, flags);
+
return full_count;
}
diff -puN arch/ia64/kernel/iosapic.c~ia64_irq_affinity_fix arch/ia64/kernel/iosapic.c
--- linux-2.6.5-lhcs/arch/ia64/kernel/iosapic.c~ia64_irq_affinity_fix 2004-05-03 16:30:29.807682525 -0700
+++ linux-2.6.5-lhcs-root/arch/ia64/kernel/iosapic.c 2004-05-03 16:30:29.810612214 -0700
@@ -98,6 +98,7 @@
#endif
static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED;
+cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
/* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */
@@ -327,6 +328,21 @@ iosapic_set_affinity (unsigned int irq,
#endif
}
+static inline void move_irq(int irq)
+{
+ /* note - we hold desc->lock */
+ cpumask_t tmp;
+ irq_desc_t *desc = irq_descp(irq);
+
+ if (!cpus_empty(pending_irq_cpumask[irq])) {
+ cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
+ if (unlikely(!cpus_empty(tmp))) {
+ desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
+ }
+ cpus_clear(pending_irq_cpumask[irq]);
+ }
+}
+
/*
* Handlers for level-triggered interrupts.
*/
@@ -343,6 +359,7 @@ iosapic_end_level_irq (unsigned int irq)
{
ia64_vector vec = irq_to_vector(irq);
+ move_irq(irq);
writel(vec, iosapic_intr_info[vec].addr + IOSAPIC_EOI);
}
@@ -382,6 +399,8 @@ static void
iosapic_ack_edge_irq (unsigned int irq)
{
irq_desc_t *idesc = irq_descp(irq);
+
+ move_irq(irq);
/*
* Once we have recorded IRQ_PENDING already, we can mask the
* interrupt for real. This prevents IRQ storms from unhandled
_
next prev parent reply other threads:[~2004-05-04 14:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-29 16:21 take3: Updated CPU Hotplug patches for IA64 [just the last patch 7/7]cpu_present_map.patch Ashok Raj
2004-04-29 16:21 ` Ashok Raj
2004-05-04 14:40 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [1/7] Ashok Raj
2004-05-04 14:40 ` Ashok Raj
2004-05-04 17:15 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch Paul Jackson
2004-05-04 17:15 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [1/7] Paul Jackson
2004-05-04 14:43 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [3/7] Ashok Raj
2004-05-04 14:43 ` Ashok Raj
2004-05-04 14:45 ` Ashok Raj [this message]
2004-05-04 14:45 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [4/7] Ashok Raj
2004-05-04 14:46 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [5/7] Ashok Raj
2004-05-04 14:46 ` Ashok Raj
2004-05-04 14:48 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [6/7] Ashok Raj
2004-05-04 14:48 ` Ashok Raj
2004-05-04 14:49 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [7/7] Ashok Raj
2004-05-04 14:49 ` Ashok Raj
2004-05-04 14:51 ` take3: Updated CPU Hotplug patches for IA64 (pj blessed) Patch [2/7] Ashok Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040504074535.D1909@unix-os.sc.intel.com \
--to=ashok.raj@intel.com \
--cc=akpm@osdl.org \
--cc=davidm@hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
--cc=rusty@rustycorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.