diff options
author | Amerigo Wang <amwang@redhat.com> | 2011-07-25 20:13:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:14 -0400 |
commit | 80f1ff97d0a9d92f44d2b2dd9425afa950e58f2b (patch) | |
tree | bee18bc88b112e75ca026b1a2b406f9f909e91bc | |
parent | a1bb73d76bc814e9385390e6aa9880d884322e2e (diff) |
notifiers: cpu: move cpu notifiers into cpu.h
We presently define all kinds of notifiers in notifier.h. This is not
necessary at all, since different subsystems use different notifiers, they
are almost non-related with each other.
This can also save much build time. Suppose I add a new netdevice event,
really I don't have to recompile all the source, just network related.
Without this patch, all the source will be recompiled.
I move the notify events near to their subsystem notifier registers, so
that they can be found more easily.
This patch:
It is not necessary to share the same notifier.h.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/cpu.h | 33 | ||||
-rw-r--r-- | include/linux/notifier.h | 34 | ||||
-rw-r--r-- | net/rds/page.c | 1 |
3 files changed, 36 insertions, 32 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 5f09323ee880..b1a635acf72a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -70,6 +70,39 @@ enum { | |||
70 | CPU_PRI_WORKQUEUE = 5, | 70 | CPU_PRI_WORKQUEUE = 5, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | ||
74 | #define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ | ||
75 | #define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ | ||
76 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ | ||
77 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | ||
78 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | ||
79 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | ||
80 | * not handling interrupts, soon dead. | ||
81 | * Called on the dying cpu, interrupts | ||
82 | * are already disabled. Must not | ||
83 | * sleep, must not fail */ | ||
84 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
85 | * lock is dropped */ | ||
86 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
87 | * Called on the new cpu, just before | ||
88 | * enabling interrupts. Must not sleep, | ||
89 | * must not fail */ | ||
90 | |||
91 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | ||
92 | * operation in progress | ||
93 | */ | ||
94 | #define CPU_TASKS_FROZEN 0x0010 | ||
95 | |||
96 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | ||
97 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | ||
98 | #define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN) | ||
99 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | ||
100 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | ||
101 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | ||
102 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | ||
103 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
104 | |||
105 | |||
73 | #ifdef CONFIG_SMP | 106 | #ifdef CONFIG_SMP |
74 | /* Need to know about CPUs going up/down? */ | 107 | /* Need to know about CPUs going up/down? */ |
75 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 108 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index c0688b0168b3..9eb25fc0145b 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -185,6 +185,8 @@ static inline int notifier_to_errno(int ret) | |||
185 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... | 185 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... |
186 | */ | 186 | */ |
187 | 187 | ||
188 | /* CPU notfiers are defined in include/linux/cpu.h. */ | ||
189 | |||
188 | /* netdevice notifier chain. Please remember to update the rtnetlink | 190 | /* netdevice notifier chain. Please remember to update the rtnetlink |
189 | * notification exclusion list in rtnetlink_event() when adding new | 191 | * notification exclusion list in rtnetlink_event() when adding new |
190 | * types. | 192 | * types. |
@@ -220,38 +222,6 @@ static inline int notifier_to_errno(int ret) | |||
220 | 222 | ||
221 | #define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ | 223 | #define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ |
222 | 224 | ||
223 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | ||
224 | #define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ | ||
225 | #define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ | ||
226 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ | ||
227 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | ||
228 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | ||
229 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | ||
230 | * not handling interrupts, soon dead. | ||
231 | * Called on the dying cpu, interrupts | ||
232 | * are already disabled. Must not | ||
233 | * sleep, must not fail */ | ||
234 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
235 | * lock is dropped */ | ||
236 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
237 | * Called on the new cpu, just before | ||
238 | * enabling interrupts. Must not sleep, | ||
239 | * must not fail */ | ||
240 | |||
241 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | ||
242 | * operation in progress | ||
243 | */ | ||
244 | #define CPU_TASKS_FROZEN 0x0010 | ||
245 | |||
246 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | ||
247 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | ||
248 | #define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN) | ||
249 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | ||
250 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | ||
251 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | ||
252 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | ||
253 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
254 | |||
255 | /* Hibernation and suspend events */ | 225 | /* Hibernation and suspend events */ |
256 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | 226 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ |
257 | #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ | 227 | #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ |
diff --git a/net/rds/page.c b/net/rds/page.c index d8acdebe3c7c..b82d63e77b03 100644 --- a/net/rds/page.c +++ b/net/rds/page.c | |||
@@ -32,6 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | #include <linux/highmem.h> | 33 | #include <linux/highmem.h> |
34 | #include <linux/gfp.h> | 34 | #include <linux/gfp.h> |
35 | #include <linux/cpu.h> | ||
35 | 36 | ||
36 | #include "rds.h" | 37 | #include "rds.h" |
37 | 38 | ||