Skip to contentSkip to conversation

genirq: Provide !SMP stub for irq_set_affinity_notifier()

DISCUSSION Greg KH 2 participants 3 messages Jun 11, 2014 – Jun 12, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Greg KH

author
#1 lore raw

Eyal, the commit you reference below isn't anywhere to be found in Linus's tree. Why is this commit needed at all if that one isn't there either?

Confused,

greg k-h

Quoted 107 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/linus/;a=commit;h=f0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de
Commit:     f0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de
Parent:     d6d211db37e75de2ddc3a4f979038c40df7cc79c
Refname:    refs/heads/master
Author:     Eyal Perry <[email protected]>
AuthorDate: Tue May 20 17:57:00 2014 +0300
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed May 21 11:31:51 2014 +0900

genirq: Provide !SMP stub for irq_set_affinity_notifier()

Instead of requiring each consumer of the IRQ affinity notifier to have themselves be explicitly dependent on CONFIG_SMP, make the definition of struct irq_affinity_notify to exist independently of that config option and introduce a stub for irq_set_affinity_notifier() under non SMP configuration.

Fixes 2eacc23 ("net/mlx4_core: Enforce irq affinity changes

immediatly")

---
 include/linux/interrupt.h |   46 +++++++++++++++++++++++++-------------------
 1 files changed, 26 insertions(+), 20 deletions(-)
include/linux/interrupt.h +26 -21
index 97ac926..3f74c05 100644
@@ -199,6 +199,26 @@ extern int check_wakeup_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;
+	struct work_struct work;
+	void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
+	void (*release)(struct kref *ref);
+};
+
 #if defined(CONFIG_SMP)
 
 extern cpumask_var_t irq_default_affinity;
@@ -242,26 +262,6 @@ extern int irq_select_affinity(unsigned int irq);
 
 extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
 
-/**
- * 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;
-	struct work_struct work;
-	void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
-	void (*release)(struct kref *ref);
-};
-
 extern int
 irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
 
@@ -284,6 +284,12 @@ 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;
+}
 #endif /* CONFIG_SMP */
 
 /*
--

To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hello Greg,

The commit I refer is now in the net-next tree, see there these two:

9e311e7 net/mlx4_en: Use affinity hint
da91309 cpumask: Utility function to set n'th cpu - local cpu first

As of other issues both were accepted and later reverted, but are now back and will be pushed by Dave Miller for 3.16-rc1

#3 lore raw

Greg,

Sorry, there was a little mess here,
I was wrongly referring to two other commits... so again --

The commit 2eacc23 ("net/mlx4_core: Enforce irq affinity changes immediately") is present in Dave's net-next tree and will be pushed by Dave to Linus for the 3.16 merge window

Hope this helps to clarify

Best Regards,
Eyal.