diff options
author | 2020-06-22 12:01:25 +0200 | |
---|---|---|
committer | 2020-06-28 17:01:20 +0200 | |
commit | 8c4890d1c3358fb8023d46e1e554c41d54f02878 (patch) | |
tree | 836a9611ccb151ac7d1e6f71c23b32a964164e9b /include/linux/smp.h | |
parent | sched/core: s/WF_ON_RQ/WQ_ON_CPU/ (diff) | |
download | linux-8c4890d1c3358fb8023d46e1e554c41d54f02878.tar.gz linux-8c4890d1c3358fb8023d46e1e554c41d54f02878.tar.bz2 linux-8c4890d1c3358fb8023d46e1e554c41d54f02878.zip |
smp, irq_work: Continue smp_call_function*() and irq_work*() integration
Instead of relying on BUG_ON() to ensure the various data structures
line up, use a bunch of horrible unions to make it all automatic.
Much of the union magic is to ensure irq_work and smp_call_function do
not (yet) see the members of their respective data structures change
name.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20200622100825.844455025@infradead.org
Diffstat (limited to 'include/linux/smp.h')
-rw-r--r-- | include/linux/smp.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h index 7ee202ad21a6..80d557ef8a11 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -12,29 +12,22 @@ #include <linux/list.h> #include <linux/cpumask.h> #include <linux/init.h> -#include <linux/llist.h> +#include <linux/smp_types.h> typedef void (*smp_call_func_t)(void *info); typedef bool (*smp_cond_func_t)(int cpu, void *info); -enum { - CSD_FLAG_LOCK = 0x01, - - /* IRQ_WORK_flags */ - - CSD_TYPE_ASYNC = 0x00, - CSD_TYPE_SYNC = 0x10, - CSD_TYPE_IRQ_WORK = 0x20, - CSD_TYPE_TTWU = 0x30, - CSD_FLAG_TYPE_MASK = 0xF0, -}; - /* * structure shares (partial) layout with struct irq_work */ struct __call_single_data { - struct llist_node llist; - unsigned int flags; + union { + struct __call_single_node node; + struct { + struct llist_node llist; + unsigned int flags; + }; + }; smp_call_func_t func; void *info; }; |