IRQ affinity reverse-mapping
Subsystems (4)
cover IRQ affinity reverse-mapping
This patch series is intended to support queue selection on multiqueue IRQ-per-queue network devices (accelerated RFS and XPS-MQ) and potentially queue selection for other classes of multiqueue device.
The first patch implements IRQ affinity notifiers, based on the outline that Thomas wrote in response to my earlier patch series for accelerated RFS.
The second patch is a generalisation of the CPU affinity reverse- mapping, plus functions to maintain such a mapping based on the new IRQ affinity notifiers.
I would like to be able to use this functionality in networking for 2.6.38. Thomas, if you are happy with this, could these changes go through net-next-2.6? Alternately, if Linus pulls from linux-2.6-tip and David pulls from Linus during the merge window, I can (re-)submit the dependent changes after that.
Ben.
Ben Hutchings (2):
genirq: Add IRQ affinity notifiers
lib: cpu_rmap: CPU affinity reverse-mapping
include/linux/cpu_rmap.h | 73 +++++++++++++ include/linux/interrupt.h | 41 +++++++ include/linux/irqdesc.h | 3 + kernel/irq/manage.c | 81 ++++++++++++++ lib/Kconfig | 4 + lib/Makefile | 2 + lib/cpu_rmap.c | 262 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 466 insertions(+), 0 deletions(-) create mode 100644 include/linux/cpu_rmap.h create mode 100644 lib/cpu_rmap.c
Signature · 7 lines
1.7.3.4 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 1/2 genirq: Add IRQ affinity notifiers
When initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add a notification mechanism to support this.
This is based closely on work by Thomas Gleixner <[email protected]>.
--- include/linux/interrupt.h | 41 +++++++++++++++++++++++ include/linux/irqdesc.h | 3 ++ kernel/irq/manage.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 0 deletions(-)
include/linux/interrupt.h +41 -0
@@ -14,6 +14,8 @@#include <linux/smp.h> #include <linux/percpu.h> #include <linux/hrtimer.h> +#include <linux/kref.h> +#include <linux/workqueue.h> #include <asm/atomic.h> #include <asm/ptrace.h>
@@ -231,6 +233,28 @@ static inline void resume_device_irqs(void) { };static inline int check_wakeup_irqs (void ) {return 0 ; }#endif +/** +* struct irq_affinity_notify - context for notification of IRQ affinity changes +* @irq: Interrupt to which notification applies +* @kref: Reference count, for internal use +* @work: Work item, for internal use +* @notify: Function to be called on change. This will be +* called in process context. +* @release: Function to be called on release. This will be +* called in process context. Once registered, the +* structure must only be freed when this function is +* called or later. +*/ +struct irq_affinity_notify { +unsigned int irq; +struct kref kref; +#if defined(CONFIG_SMP ) && defined(CONFIG_GENERIC_HARDIRQS ) +struct work_struct work; +#endif +void (*notify)(struct irq_affinity_notify *,const cpumask_t *mask); +void (*release)(struct kref *ref); +}; +#if defined(CONFIG_SMP ) && defined(CONFIG_GENERIC_HARDIRQS )extern cpumask_var_t irq_default_affinity;
@@ -240,6 +264,13 @@ extern int irq_can_set_affinity(unsigned int irq);extern int irq_select_affinity (unsigned int irq);extern int irq_set_affinity_hint (unsigned int irq,const struct cpumask *m); +extern int +irq_set_affinity_notifier (unsigned int irq,struct irq_affinity_notify *notify); + +static inline void irq_run_affinity_notifiers (void ) +{ +flush_scheduled_work (); +}#else /* CONFIG_SMP */ static inline int irq_set_affinity (unsigned int irq,const struct cpumask *m)
@@ -259,6 +290,16 @@ static inline int irq_set_affinity_hint(unsigned int irq, {return -EINVAL ; } + +static inline int +irq_set_affinity_notifier (unsigned int irq,struct irq_affinity_notify *notify) +{ +return 0 ; +} + +static inline void irq_run_affinity_notifiers (void ) +{ +}#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ #ifdef CONFIG_GENERIC_HARDIRQS
include/linux/irqdesc.h +3 -0
@@ -8,6 +8,7 @@* For now it's included from <linux/irq.h> */ +struct irq_affinity_notify ;struct proc_dir_entry ;struct timer_rand_state ;/**
@@ -24,6 +25,7 @@ struct timer_rand_state;* @last_unhandled: aging timer for unhandled count * @irqs_unhandled: stats field for spurious unhandled interrupts * @lock: locking for SMP +* @affinity_notify: context for notification of affinity changes * @pending_mask: pending rebalanced interrupts * @threads_active: number of irqaction threads currently running * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
@@ -70,6 +72,7 @@ struct irq_desc {raw_spinlock_t lock;#ifdef CONFIG_SMP const struct cpumask *affinity_hint; +struct irq_affinity_notify *affinity_notify;#ifdef CONFIG_GENERIC_PENDING_IRQ cpumask_var_t pending_mask;#endif
kernel/irq/manage.c +81 -0
99 lines not on this page · raw message
Signature · 7 lines
1.7.3.4 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 2/2 lib: cpu_rmap: CPU affinity reverse-mapping
In reply to Ben HutchingsWhen initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add library functions to support a generic reverse-mapping from CPUs to objects with affinity and the specific case where the objects are IRQs.
--- include/linux/cpu_rmap.h | 73 +++++++++++++ lib/Kconfig | 4 + lib/Makefile | 2 + lib/cpu_rmap.c | 262 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 341 insertions(+), 0 deletions(-) create mode 100644 include/linux/cpu_rmap.h create mode 100644 lib/cpu_rmap.c
include/linux/cpu_rmap.h new file +73 -0
@@ -0,0 +1,73 @@ +/* +* cpu_rmap.c: CPU affinity reverse-map support +* Copyright 2010 Solarflare Communications Inc. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published +* by the Free Software Foundation, incorporated herein by reference. +*/ + +#include <linux/cpumask.h> +#include <linux/gfp.h> +#include <linux/slab.h> + +/** +* struct cpu_rmap - CPU affinity reverse-map +* @near: For each CPU, the index and distance to the nearest object, +* based on affinity masks +* @size: Number of objects to be reverse-mapped +* @used: Number of objects added +* @obj: Array of object pointers +*/ +struct cpu_rmap { +struct { +u16 index; +u16 dist; + } near[NR_CPUS ]; +u16 size, used; +void *obj[0 ]; +}; +#define CPU_RMAP_DIST_INF 0xffff + +extern struct cpu_rmap *alloc_cpu_rmap (unsigned int size,gfp_t flags); + +/** +* free_cpu_rmap - free CPU affinity reverse-map +* @rmap: Reverse-map allocated with alloc_cpu_rmap(), or %NULL +*/ +static inline void free_cpu_rmap (struct cpu_rmap *rmap) +{ +kfree (rmap); +} + +extern int cpu_rmap_add (struct cpu_rmap *rmap,void *obj); +extern int cpu_rmap_update (struct cpu_rmap *rmap,u16 index, +const struct cpumask *affinity); + +static inline u16 cpu_rmap_lookup_index (struct cpu_rmap *rmap,unsigned int cpu) +{ +return rmap->near[cpu].index; +} + +static inline void *cpu_rmap_lookup_obj (struct cpu_rmap *rmap,unsigned int cpu) +{ +return rmap->obj[rmap->near[cpu].index]; +} + +#ifdef CONFIG_GENERIC_HARDIRQS + +/** +* alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs +* @size: Number of objects to be mapped +* +* Must be called in process context. +*/ +static inline struct cpu_rmap *alloc_irq_cpu_rmap (unsigned int size) +{ +return alloc_cpu_rmap (size,GFP_KERNEL ); +} +extern void free_irq_cpu_rmap (struct cpu_rmap *rmap); + +extern int irq_cpu_rmap_add (struct cpu_rmap *rmap,int irq); + +#endif
lib/Kconfig +4 -0
@@ -195,6 +195,10 @@ config DISABLE_OBSOLETE_CPUMASK_FUNCTIONS bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS depends on EXPERIMENTAL && BROKEN +config CPU_RMAP + bool + depends on SMP + # # Netlink attribute parsing support is select'ed if needed #
lib/Makefile +2 -0
@@ -110,6 +110,8 @@ obj-$(CONFIG_ATOMIC64_SELFTEST) += atomic64_test.o obj-$(CONFIG_AVERAGE) += average.o +obj-$(CONFIG_CPU_RMAP) += cpu_rmap.o + hostprogs-y := gen_crc32table clean-files := crc32table.h
lib/cpu_rmap.c new file +262 -0
262 lines not on this page · raw message
Signature · 7 lines
1.7.3.4 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 2/2] lib: cpu_rmap: CPU affinity reverse-mapping
Quoted 39 lines · Ben Hutchings
When initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add library functions to support a generic reverse-mapping from CPUs to objects with affinity and the specific case where the objects are IRQs.
Signed-off-by Ben Hutchings <[email protected]>--- include/linux/cpu_rmap.h | 73 +++++++++++++ lib/Kconfig | 4 + lib/Makefile | 2 + lib/cpu_rmap.c | 262 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 341 insertions(+), 0 deletions(-) create mode 100644 include/linux/cpu_rmap.h create mode 100644 lib/cpu_rmap.cinclude/linux/cpu_rmap.h new file +16
-0@@ -0,0 +1,73 @@ +/* +* cpu_rmap.c: CPU affinity reverse-map support +* Copyright 2010 Solarflare Communications Inc. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published +* by the Free Software Foundation, incorporated herein by reference. +*/ + +#include <linux/cpumask.h> +#include <linux/gfp.h> +#include <linux/slab.h> + +/** +* struct cpu_rmap - CPU affinity reverse-map +* @near: For each CPU, the index and distance to the nearest object,
include/linux/cpu_rmap.h line 26
Quoted 10 lines
include/linux/cpu_rmap.h new file +10
-0+* based on affinity masks +* @size: Number of objects to be reverse-mapped +* @used: Number of objects added +* @obj: Array of object pointers +*/ +struct cpu_rmap { +struct { +u16 index; +u16 dist; + } near[NR_CPUS ];
This [NR_CPUS] is highly suspect.
Are you sure you cant use a per_cpu allocation here ?
include/linux/cpu_rmap.h line 64
Quoted 13 lines
include/linux/cpu_rmap.h new file +11
-0+u16 size, used; +void *obj[0 ]; +}; +#define CPU_RMAP_DIST_INF 0xffff + + +/** +* alloc_cpu_rmap - allocate CPU affinity reverse-map +* @size: Number of objects to be mapped +* @flags: Allocation flags e.g. %GFP_KERNEL +*/
I really doubt you need other than GFP_KERNEL. (Especially if you switch to per_cpu alloc ;) )
Quoted 12 lines
include/linux/cpu_rmap.h new file +12
-0+struct cpu_rmap *alloc_cpu_rmap (unsigned int size,gfp_t flags) +{ +struct cpu_rmap *rmap; +unsigned int cpu; + +/* This is a silly number of objects, and we use u16 indices. */ +if (size >0xffff ) +return NULL ; + + rmap =kzalloc (sizeof (*rmap) + size *sizeof (rmap->obj[0 ]), flags); +if (!rmap) +return NULL ;
Re: [PATCH 2/2] lib: cpu_rmap: CPU affinity reverse-mapping
Quoted 7 lines · Eric Dumazet
Quoted 6 lines · Ben Hutchings
When initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add library functions to support a generic reverse-mapping from CPUs to objects with affinity and the specific case where the objects are IRQs.
[...]
Quoted 16 lines
include/linux/cpu_rmap.h line 26
Quoted 13 lines
include/linux/cpu_rmap.h new file +13
-0+/** +* struct cpu_rmap - CPU affinity reverse-map +* @near: For each CPU, the index and distance to the nearest object, +* based on affinity masks +* @size: Number of objects to be reverse-mapped +* @used: Number of objects added +* @obj: Array of object pointers +*/ +struct cpu_rmap { +struct { +u16 index; +u16 dist; + } near[NR_CPUS ];This [
NR_CPUS] is highly suspect.
Quoted 1 line
Are you sure you cant use a
per_cpuallocation here ?
I think that would be a waste of space in shared caches, as this is read-mostly.
Quoted 7 lines
Quoted 5 lines
include/linux/cpu_rmap.h new file +5
-0+u16 size, used; +void *obj[0 ]; +}; +#define CPU_RMAP_DIST_INF 0xffff +
Quoted 9 lines
lib/cpu_rmap.c line 29
Quoted 6 lines
lib/cpu_rmap.c new file +6
-0+ +/** +* alloc_cpu_rmap - allocate CPU affinity reverse-map +* @size: Number of objects to be mapped +* @flags: Allocation flags e.g. %GFP_KERNEL +*/ I really doubt you need other than
GFP_KERNEL. (Especially if you switch toper_cpualloc ;) )
[...]
I agree, but this is consistent with ~all other allocation functions.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 2/2] lib: cpu_rmap: CPU affinity reverse-mapping
Quoted 25 lines · Ben Hutchings
Quoted 7 lines · Eric Dumazet
Quoted 6 lines · Ben Hutchings
When initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add library functions to support a generic reverse-mapping from CPUs to objects with affinity and the specific case where the objects are IRQs.
[...]
Quoted 16 lines
include/linux/cpu_rmap.h line 26
Quoted 13 lines
include/linux/cpu_rmap.h new file +13
-0+/** +* struct cpu_rmap - CPU affinity reverse-map +* @near: For each CPU, the index and distance to the nearest object, +* based on affinity masks +* @size: Number of objects to be reverse-mapped +* @used: Number of objects added +* @obj: Array of object pointers +*/ +struct cpu_rmap { +struct { +u16 index; +u16 dist; + } near[NR_CPUS ];This [
NR_CPUS] is highly suspect.
Quoted 4 lines
Quoted 1 line
Are you sure you cant use a
per_cpuallocation here ?I think that would be a waste of space in shared caches, as this is read-mostly.
This is slow path, unless I dont understood the intent.
Cache lines dont matter. I was not concerned about speed but memory needs.
NR_CPUS can be 4096 on some distros, that means a 32Kbyte allocation.
Really, you'll have to have very strong arguments to introduce an [NR_CPUS] array in the kernel today.
Re: [PATCH 2/2] lib: cpu_rmap: CPU affinity reverse-mapping
Quoted 26 lines · Eric Dumazet
Quoted 25 lines · Ben Hutchings
Quoted 7 lines · Eric Dumazet
Quoted 6 lines · Ben Hutchings
When initiating I/O on a multiqueue and multi-IRQ device, we may want to select a queue for which the response will be handled on the same or a nearby CPU. This requires a reverse-map of IRQ affinity. Add library functions to support a generic reverse-mapping from CPUs to objects with affinity and the specific case where the objects are IRQs.
[...]
Quoted 16 lines
include/linux/cpu_rmap.h line 26
Quoted 13 lines
include/linux/cpu_rmap.h new file +13
-0+/** +* struct cpu_rmap - CPU affinity reverse-map +* @near: For each CPU, the index and distance to the nearest object, +* based on affinity masks +* @size: Number of objects to be reverse-mapped +* @used: Number of objects added +* @obj: Array of object pointers +*/ +struct cpu_rmap { +struct { +u16 index; +u16 dist; + } near[NR_CPUS ];This [
NR_CPUS] is highly suspect.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Are you sure you cant use a
per_cpuallocation here ?I think that would be a waste of space in shared caches, as this is read-mostly.
This is slow path, unless I dont understood the intent.
get_rps_cpu() will need to read from an arbitrary entry in cpu_rmap (not the current CPU's entry) for each new flow and for each flow that went idle for a while. That's not fast path but it is part of the data path, not the control path.
Quoted 7 lines
Cache lines dont matter. I was not concerned about speed but memory needs.
NR_CPUScan be 4096 on some distros, that means a 32Kbyte allocation.Really, you'll have to have very strong arguments to introduce an [
NR_CPUS] array in the kernel today.
I could replace this with a pointer to an array of size num_possible_cpus(). But I think per_cpu is wrong here.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 2/2] lib: cpu_rmap: CPU affinity reverse-mapping
Quoted 5 lines · Ben Hutchings
get_rps_cpu()will need to read from an arbitrary entry incpu_rmap(not the current CPU's entry) for each new flow and for each flow that went idle for a while. That's not fast path but it is part of the data path, not the control path.
Hmm, I call this fast path :(
Quoted 10 lines
Quoted 7 lines
Cache lines dont matter. I was not concerned about speed but memory needs.
NR_CPUScan be 4096 on some distros, that means a 32Kbyte allocation.Really, you'll have to have very strong arguments to introduce an [
NR_CPUS] array in the kernel today.I could replace this with a pointer to an array of size
num_possible_cpus(). But I thinkper_cpuis wrong here.
Yes, an dynamic array is acceptable
You probably mean nr_cpu_ids
Re: [PATCH 1/2] genirq: Add IRQ affinity notifiers
In reply to Ben HutchingsQuoted 6 lines · Ben Hutchings
include/linux/interrupt.h +6
-0+/** +* struct irq_affinity_notify - context for notification of IRQ affinity changes +* @irq: Interrupt to which notification applies +* @kref: Reference count, for internal use +* @work: Work item, for internal use +* @notify: Function to be called on change. This will be
include/linux/interrupt.h static inline void resume_device_irqs(void) { }; · line 251
Quoted 10 lines
include/linux/interrupt.h +10
-0+* called in process context. +* @release: Function to be called on release. This will be +* called in process context. Once registered, the +* structure must only be freed when this function is +* called or later. +*/ +struct irq_affinity_notify { +unsigned int irq; +struct kref kref; +#if defined(CONFIG_SMP ) && defined(CONFIG_GENERIC_HARDIRQS )
The whole affinity thing is SMP and GENERIC_HARDIRQS only anyway, so what's the point of this ifdeffery ?
Quoted 6 lines
(quoted diff) +6
-0+ struct work_struct work; +#endif + void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); + void (*release)(struct kref *ref); +}; +
Review
Quoted 10 lines
(quoted diff) +9
-0+/** + * irq_set_affinity_notifier - control notification of IRQ affinity changes + * @irq: Interrupt for which to enable/disable notification + * @notify: Context for notification, or %NULL to disable + * notification. Function pointers must be initialised; + * the other fields will be initialised by this function. + * + * Must be called in process context. Notification may only be enabled + * after the IRQ is allocated but before it is bound with request_irq()
Why? And if there is that restriction, then it needs to be checked. But I don't see why this is necessary.
kernel/irq/manage.c void free_irq(unsigned int irq, void *dev_id) · line 1085
Quoted 5 lines
+ * and must be disabled before the IRQ is freed using
free_irq().
+ */kernel/irq/manage.c +2
-0+#ifdef CONFIG_SMP +BUG_ON (desc->affinity_notify);
We should be nice here and just WARN and fixup the wreckage by uninstalling it.
Thanks,
tglx
Re: [PATCH 1/2] genirq: Add IRQ affinity notifiers
Quoted 12 lines · Thomas Gleixner
Quoted 11 lines · Ben Hutchings
+/**
+ * structirq_affinity_notify- context for notification of IRQ affinity changes
+ * @irq: Interrupt to which notification applies
+ * @kref: Reference count, for internal use
+ * @work: Work item, for internal use
+ * @notify: Function to be called on change. This will be
+ * called in process context.
+ * @release: Function to be called on release. This will be
+ * called in process context. Once registered, the
+ * structure must only be freed when this function is
+ * called or later.
Quoted 8 lines
include/linux/interrupt.h static inline void resume_device_irqs(void) { }; · line 251
Quoted 5 lines
+ */
include/linux/interrupt.h +4
-0+struct irq_affinity_notify { +unsigned int irq; +struct kref kref; +#if defined(CONFIG_SMP ) && defined(CONFIG_GENERIC_HARDIRQS )The whole affinity thing is SMP and
GENERIC_HARDIRQSonly anyway, so what's the point of this ifdeffery ?
The intent is that code using this can be compiled even if those config options are not set. The work_struct is not needed in that case. I think this is probably pointless though.
Quoted 17 lines
Quoted 6 lines
(quoted diff) +6
-0+ struct work_struct work; +#endif + void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); + void (*release)(struct kref *ref); +}; +Review
Quoted 10 lines
(quoted diff) +9
-0+/** + * irq_set_affinity_notifier - control notification of IRQ affinity changes + * @irq: Interrupt for which to enable/disable notification + * @notify: Context for notification, or %NULL to disable + * notification. Function pointers must be initialised; + * the other fields will be initialised by this function. + * + * Must be called in process context. Notification may only be enabled + * after the IRQ is allocated but before it is bound with request_irq()
Quoted 2 lines
Why? And if there is that restriction, then it needs to be checked. But I don't see why this is necessary.
Which restriction?
Quoted 8 lines
kernel/irq/manage.c void free_irq(unsigned int irq, void *dev_id) · line 1085
Quoted 5 lines
+ * and must be disabled before the IRQ is freed using
free_irq().
+ */kernel/irq/manage.c +2
-0+#ifdef CONFIG_SMP +BUG_ON (desc->affinity_notify);We should be nice here and just WARN and fixup the wreckage by uninstalling it.
OK.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH 1/2] genirq: Add IRQ affinity notifiers
Quoted 9 lines · Ben Hutchings
Quoted 4 lines · Thomas Gleixner
Quoted 1 line
+#if
defined(CONFIG_SMP)&&defined(CONFIG_GENERIC_HARDIRQS)The whole affinity thing is SMP and
GENERIC_HARDIRQSonly anyway, so what's the point of this ifdeffery ?The intent is that code using this can be compiled even if those config options are not set. The
work_structis not needed in that case. I think this is probably pointless though.
Yup, work_struct is defined for the !SMP and !GENERIC_HARDIRQS case as well :)
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
(quoted diff) +15
-0+ struct work_struct work; +#endif + void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask); + void (*release)(struct kref *ref); +}; + +/** + * irq_set_affinity_notifier - control notification of IRQ affinity changes + * @irq: Interrupt for which to enable/disable notification + * @notify: Context for notification, or %NULL to disable + * notification. Function pointers must be initialised; + * the other fields will be initialised by this function. + * + * Must be called in process context. Notification may only be enabled + * after the IRQ is allocated but before it is bound with request_irq()
Quoted 4 lines
Quoted 2 lines
Why? And if there is that restriction, then it needs to be checked. But I don't see why this is necessary.
Which restriction?
Notification may only be enabled after the IRQ is allocated but before it is bound with request_irq()
After IRQ is allocated is obvious, but why needs it to be done _before_ request_irq() ?
Thanks,
tglx