Skip to content

Commit 44082fd

Browse files
committed
genirq/affinity: Remove old irq spread infrastructure
No more users. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Christoph Hellwig <hch@lst.de> Cc: axboe@fb.com Cc: keith.busch@intel.com Cc: agordeev@redhat.com Cc: linux-block@vger.kernel.org Link: http://lkml.kernel.org/r/1473862739-15032-5-git-send-email-hch@lst.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent e75eafb commit 44082fd

File tree

2 files changed

+0
-65
lines changed

2 files changed

+0
-65
lines changed

include/linux/interrupt.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
278278
extern int
279279
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
280280

281-
struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs);
282281
struct cpumask *irq_create_affinity_masks(const struct cpumask *affinity, int nvec);
283282
int irq_calc_affinity_vectors(const struct cpumask *affinity, int maxvec);
284283

@@ -313,12 +312,6 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
313312
return 0;
314313
}
315314

316-
static inline struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs)
317-
{
318-
*nr_vecs = 1;
319-
return NULL;
320-
}
321-
322315
static inline struct cpumask *
323316
irq_create_affinity_masks(const struct cpumask *affinity, int nvec)
324317
{

kernel/irq/affinity.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -152,61 +152,3 @@ int irq_calc_affinity_vectors(const struct cpumask *affinity, int maxvec)
152152
put_online_cpus();
153153
return ret;
154154
}
155-
156-
static int get_first_sibling(unsigned int cpu)
157-
{
158-
unsigned int ret;
159-
160-
ret = cpumask_first(topology_sibling_cpumask(cpu));
161-
if (ret < nr_cpu_ids)
162-
return ret;
163-
return cpu;
164-
}
165-
166-
/*
167-
* Take a map of online CPUs and the number of available interrupt vectors
168-
* and generate an output cpumask suitable for spreading MSI/MSI-X vectors
169-
* so that they are distributed as good as possible around the CPUs. If
170-
* more vectors than CPUs are available we'll map one to each CPU,
171-
* otherwise we map one to the first sibling of each socket.
172-
*
173-
* If there are more vectors than CPUs we will still only have one bit
174-
* set per CPU, but interrupt code will keep on assigning the vectors from
175-
* the start of the bitmap until we run out of vectors.
176-
*/
177-
struct cpumask *irq_create_affinity_mask(unsigned int *nr_vecs)
178-
{
179-
struct cpumask *affinity_mask;
180-
unsigned int max_vecs = *nr_vecs;
181-
182-
if (max_vecs == 1)
183-
return NULL;
184-
185-
affinity_mask = kzalloc(cpumask_size(), GFP_KERNEL);
186-
if (!affinity_mask) {
187-
*nr_vecs = 1;
188-
return NULL;
189-
}
190-
191-
get_online_cpus();
192-
if (max_vecs >= num_online_cpus()) {
193-
cpumask_copy(affinity_mask, cpu_online_mask);
194-
*nr_vecs = num_online_cpus();
195-
} else {
196-
unsigned int vecs = 0, cpu;
197-
198-
for_each_online_cpu(cpu) {
199-
if (cpu == get_first_sibling(cpu)) {
200-
cpumask_set_cpu(cpu, affinity_mask);
201-
vecs++;
202-
}
203-
204-
if (--max_vecs == 0)
205-
break;
206-
}
207-
*nr_vecs = vecs;
208-
}
209-
put_online_cpus();
210-
211-
return affinity_mask;
212-
}

0 commit comments

Comments
 (0)