From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
Eric Biederman <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 3/8] sparseirq: change irq_desc_ptrs to static
Date: Fri, 12 Feb 2010 18:49:45 -0800 [thread overview]
Message-ID: <1266029390-30907-4-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1266029390-30907-1-git-send-email-yinghai@kernel.org>
add replace_irq_desc()
-v2: remove unneeded boundary check in replace_irq_desc
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
kernel/irq/handle.c | 7 ++++++-
kernel/irq/internals.h | 6 +-----
kernel/irq/numa_migrate.c | 4 ++--
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 0e823c0..266f798 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -127,7 +127,7 @@ static void init_one_irq_desc(int irq, struct irq_desc *desc, int node)
*/
DEFINE_RAW_SPINLOCK(sparse_irq_lock);
-struct irq_desc **irq_desc_ptrs __read_mostly;
+static struct irq_desc **irq_desc_ptrs __read_mostly;
static struct irq_desc irq_desc_legacy[NR_IRQS_LEGACY] __cacheline_aligned_in_smp = {
[0 ... NR_IRQS_LEGACY-1] = {
@@ -192,6 +192,11 @@ struct irq_desc *irq_to_desc(unsigned int irq)
return NULL;
}
+void replace_irq_desc(unsigned int irq, struct irq_desc *desc)
+{
+ irq_desc_ptrs[irq] = desc;
+}
+
struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node)
{
struct irq_desc *desc;
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index b2821f0..c63f3bc 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -21,11 +21,7 @@ extern void clear_kstat_irqs(struct irq_desc *desc);
extern raw_spinlock_t sparse_irq_lock;
#ifdef CONFIG_SPARSE_IRQ
-/* irq_desc_ptrs allocated at boot time */
-extern struct irq_desc **irq_desc_ptrs;
-#else
-/* irq_desc_ptrs is a fixed size array */
-extern struct irq_desc *irq_desc_ptrs[NR_IRQS];
+void replace_irq_desc(unsigned int irq, struct irq_desc *desc);
#endif
#ifdef CONFIG_PROC_FS
diff --git a/kernel/irq/numa_migrate.c b/kernel/irq/numa_migrate.c
index 26bac9d..963559d 100644
--- a/kernel/irq/numa_migrate.c
+++ b/kernel/irq/numa_migrate.c
@@ -70,7 +70,7 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
raw_spin_lock_irqsave(&sparse_irq_lock, flags);
/* We have to check it to avoid races with another CPU */
- desc = irq_desc_ptrs[irq];
+ desc = irq_to_desc(irq);
if (desc && old_desc != desc)
goto out_unlock;
@@ -90,7 +90,7 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
goto out_unlock;
}
- irq_desc_ptrs[irq] = desc;
+ replace_irq_desc(irq, desc);
raw_spin_unlock_irqrestore(&sparse_irq_lock, flags);
/* free the old one */
--
1.6.4.2
next prev parent reply other threads:[~2010-02-13 2:51 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-13 2:49 [PATCH 0/8] tip related: radix tree for spareseirq and logical flat clean up Yinghai Lu
2010-02-13 2:49 ` [PATCH 1/8] irq: remove not need bootmem code Yinghai Lu
2010-02-13 2:49 ` [PATCH 2/8] radix: move radix init early Yinghai Lu
2010-02-13 2:49 ` Yinghai Lu [this message]
2010-02-13 2:49 ` [PATCH 4/8] sparseirq: use radix_tree instead of ptrs array Yinghai Lu
2010-02-13 2:49 ` [PATCH 5/8] x86: remove arch_probe_nr_irqs Yinghai Lu
2010-02-13 2:49 ` [PATCH 6/8] use nr_cpus= to set nr_cpu_ids early Yinghai Lu
2010-02-13 2:49 ` [PATCH 7/8] x86: use num_processors for possible cpus Yinghai Lu
2010-02-13 2:49 ` [PATCH 8/8] x86: make 32bit apic flat to physflat switch like 64bit Yinghai Lu
2010-02-13 3:44 ` [PATCH 0/8] tip related: radix tree for spareseirq and logical flat clean up Eric W. Biederman
2010-02-13 3:49 ` H. Peter Anvin
2010-02-13 4:17 ` Eric W. Biederman
2010-02-13 22:12 ` Jeremy Fitzhardinge
2010-02-13 22:26 ` Eric W. Biederman
2010-02-13 9:54 ` Yinghai Lu
2010-02-13 11:39 ` Eric W. Biederman
2010-02-13 12:04 ` Eric W. Biederman
2010-02-13 22:40 ` Yinghai Lu
2010-02-13 23:14 ` Eric W. Biederman
2010-02-13 23:59 ` Yinghai Lu
2010-02-14 0:30 ` Eric W. Biederman
2010-02-14 0:49 ` Yinghai Lu
[not found] ` <4B7CA9A1.3020806@kernel.org>
2010-02-18 2:49 ` [PATCH 0/3] radix tree spareirq addon cleanup Yinghai Lu
2010-02-18 2:50 ` [PATCH 2/3] x86: use vector_desc instead of vector_irq Yinghai Lu
2010-02-18 17:22 ` Eric W. Biederman
2010-02-23 6:39 ` [PATCH -v3 1/2] " Yinghai Lu
2010-02-23 6:44 ` [PATCH -v2 2/2] genericirq: change ack/mask in irq_chip to take irq_desc instead of irq Yinghai Lu
2010-02-24 21:36 ` Eric W. Biederman
2010-02-24 22:07 ` Yinghai Lu
2010-02-25 0:22 ` Stephen Rothwell
2010-03-02 14:58 ` Thomas Gleixner
2010-03-03 8:49 ` Yinghai Lu
2010-03-03 10:26 ` Thomas Gleixner
[not found] ` <4B84F013.9040708@kernel.org>
2010-02-24 9:26 ` [PATCH -v3 " Yinghai Lu
2010-02-24 9:27 ` [PATCH -v4 1/2] x86: use vector_desc instead of vector_irq Yinghai Lu
2010-02-18 2:50 ` [RFC PATCH 3/3] genericirq: change ack/mask in irq_chip to take irq_desc in addition to irq Yinghai Lu
2010-02-18 17:04 ` Eric W. Biederman
2010-02-18 17:13 ` H. Peter Anvin
2010-02-18 19:51 ` Yinghai Lu
2010-02-18 2:49 ` [PATCH 1/3] xen: Remove unnecessary arch specific xen irq functions Yinghai Lu
2010-02-19 1:36 ` [tip:x86/irq] " tip-bot for Eric W. Biederman
2010-02-13 12:26 ` [PATCH 0/8] tip related: radix tree for spareseirq and logical flat clean up Eric W. Biederman
2010-02-13 22:36 ` Yinghai Lu
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=1266029390-30907-4-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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.