diff options
author | Mike Travis <travis@sgi.com> | 2009-01-11 00:58:08 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-11 13:12:46 -0500 |
commit | 7f7ace0cda64c99599c23785f8979a072e118058 (patch) | |
tree | 13f2826e64e09ebaef94a3e7fd9c21cfbd31ec3f /kernel/irq/manage.c | |
parent | c59765042f53a79a7a65585042ff463b69cb248c (diff) |
cpumask: update irq_desc to use cpumask_var_t
Impact: reduce memory usage, use new cpumask API.
Replace the affinity and pending_masks with cpumask_var_t's. This adds
to the significant size reduction done with the SPARSE_IRQS changes.
The added functions (init_alloc_desc_masks & init_copy_desc_masks) are
in the include file so they can be inlined (and optimized out for the
!CONFIG_CPUMASKS_OFFSTACK case.) [Naming chosen to be consistent with
the other init*irq functions, as well as the backwards arg declaration
of "from, to" instead of the more common "to, from" standard.]
Includes a slight change to the declaration of struct irq_desc to embed
the pending_mask within ifdef(CONFIG_SMP) to be consistent with other
references, and some small changes to Xen.
Tested: sparse/non-sparse/cpumask_offstack/non-cpumask_offstack/nonuma/nosmp on x86_64
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: virtualization@lists.osdl.org
Cc: xen-devel@lists.xensource.com
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index cd0cd8dcb345..b98739af4558 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -98,14 +98,14 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
98 | 98 | ||
99 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 99 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
100 | if (desc->status & IRQ_MOVE_PCNTXT || desc->status & IRQ_DISABLED) { | 100 | if (desc->status & IRQ_MOVE_PCNTXT || desc->status & IRQ_DISABLED) { |
101 | cpumask_copy(&desc->affinity, cpumask); | 101 | cpumask_copy(desc->affinity, cpumask); |
102 | desc->chip->set_affinity(irq, cpumask); | 102 | desc->chip->set_affinity(irq, cpumask); |
103 | } else { | 103 | } else { |
104 | desc->status |= IRQ_MOVE_PENDING; | 104 | desc->status |= IRQ_MOVE_PENDING; |
105 | cpumask_copy(&desc->pending_mask, cpumask); | 105 | cpumask_copy(desc->pending_mask, cpumask); |
106 | } | 106 | } |
107 | #else | 107 | #else |
108 | cpumask_copy(&desc->affinity, cpumask); | 108 | cpumask_copy(desc->affinity, cpumask); |
109 | desc->chip->set_affinity(irq, cpumask); | 109 | desc->chip->set_affinity(irq, cpumask); |
110 | #endif | 110 | #endif |
111 | desc->status |= IRQ_AFFINITY_SET; | 111 | desc->status |= IRQ_AFFINITY_SET; |
@@ -127,16 +127,16 @@ int do_irq_select_affinity(unsigned int irq, struct irq_desc *desc) | |||
127 | * one of the targets is online. | 127 | * one of the targets is online. |
128 | */ | 128 | */ |
129 | if (desc->status & (IRQ_AFFINITY_SET | IRQ_NO_BALANCING)) { | 129 | if (desc->status & (IRQ_AFFINITY_SET | IRQ_NO_BALANCING)) { |
130 | if (cpumask_any_and(&desc->affinity, cpu_online_mask) | 130 | if (cpumask_any_and(desc->affinity, cpu_online_mask) |
131 | < nr_cpu_ids) | 131 | < nr_cpu_ids) |
132 | goto set_affinity; | 132 | goto set_affinity; |
133 | else | 133 | else |
134 | desc->status &= ~IRQ_AFFINITY_SET; | 134 | desc->status &= ~IRQ_AFFINITY_SET; |
135 | } | 135 | } |
136 | 136 | ||
137 | cpumask_and(&desc->affinity, cpu_online_mask, irq_default_affinity); | 137 | cpumask_and(desc->affinity, cpu_online_mask, irq_default_affinity); |
138 | set_affinity: | 138 | set_affinity: |
139 | desc->chip->set_affinity(irq, &desc->affinity); | 139 | desc->chip->set_affinity(irq, desc->affinity); |
140 | 140 | ||
141 | return 0; | 141 | return 0; |
142 | } | 142 | } |