diff options
author | Paul Mackerras <paulus@samba.org> | 2007-02-07 23:03:11 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-02-07 23:03:11 -0500 |
commit | d5112a4f31a361409d3c57dc9d58dd69f8014bef (patch) | |
tree | 64771300b2191cb94d9aaf60355661a01c2ccd1a /kernel | |
parent | 12e86f92fcfe4f0bcab0ad7fa4088a64c60d9b38 (diff) | |
parent | 5fad293bcbd48d9a2370020cf60e4b4a42559b12 (diff) |
Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into for-2.6.21
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 2 | ||||
-rw-r--r-- | kernel/fork.c | 2 | ||||
-rw-r--r-- | kernel/irq/manage.c | 3 | ||||
-rw-r--r-- | kernel/kprobes.c | 20 | ||||
-rw-r--r-- | kernel/pid.c | 2 | ||||
-rw-r--r-- | kernel/profile.c | 3 | ||||
-rw-r--r-- | kernel/sys.c | 15 |
7 files changed, 32 insertions, 15 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 3540172063..fec12eb124 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -938,8 +938,8 @@ fastcall NORET_TYPE void do_exit(long code) | |||
938 | 938 | ||
939 | tsk->exit_code = code; | 939 | tsk->exit_code = code; |
940 | proc_exit_connector(tsk); | 940 | proc_exit_connector(tsk); |
941 | exit_notify(tsk); | ||
942 | exit_task_namespaces(tsk); | 941 | exit_task_namespaces(tsk); |
942 | exit_notify(tsk); | ||
943 | #ifdef CONFIG_NUMA | 943 | #ifdef CONFIG_NUMA |
944 | mpol_free(tsk->mempolicy); | 944 | mpol_free(tsk->mempolicy); |
945 | tsk->mempolicy = NULL; | 945 | tsk->mempolicy = NULL; |
diff --git a/kernel/fork.c b/kernel/fork.c index fc723e595c..d57118da73 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re | |||
1313 | return regs; | 1313 | return regs; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | struct task_struct * __devinit fork_idle(int cpu) | 1316 | struct task_struct * __cpuinit fork_idle(int cpu) |
1317 | { | 1317 | { |
1318 | struct task_struct *task; | 1318 | struct task_struct *task; |
1319 | struct pt_regs regs; | 1319 | struct pt_regs regs; |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index b385878c6e..8b961adc3b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -315,6 +315,9 @@ int setup_irq(unsigned int irq, struct irqaction *new) | |||
315 | /* Undo nested disables: */ | 315 | /* Undo nested disables: */ |
316 | desc->depth = 1; | 316 | desc->depth = 1; |
317 | } | 317 | } |
318 | /* Reset broken irq detection when installing new handler */ | ||
319 | desc->irq_count = 0; | ||
320 | desc->irqs_unhandled = 0; | ||
318 | spin_unlock_irqrestore(&desc->lock, flags); | 321 | spin_unlock_irqrestore(&desc->lock, flags); |
319 | 322 | ||
320 | new->irq = irq; | 323 | new->irq = irq; |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 17ec4afb09..6fcf8dd148 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -87,6 +87,12 @@ struct kprobe_insn_page { | |||
87 | int ngarbage; | 87 | int ngarbage; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | enum kprobe_slot_state { | ||
91 | SLOT_CLEAN = 0, | ||
92 | SLOT_DIRTY = 1, | ||
93 | SLOT_USED = 2, | ||
94 | }; | ||
95 | |||
90 | static struct hlist_head kprobe_insn_pages; | 96 | static struct hlist_head kprobe_insn_pages; |
91 | static int kprobe_garbage_slots; | 97 | static int kprobe_garbage_slots; |
92 | static int collect_garbage_slots(void); | 98 | static int collect_garbage_slots(void); |
@@ -130,8 +136,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) | |||
130 | if (kip->nused < INSNS_PER_PAGE) { | 136 | if (kip->nused < INSNS_PER_PAGE) { |
131 | int i; | 137 | int i; |
132 | for (i = 0; i < INSNS_PER_PAGE; i++) { | 138 | for (i = 0; i < INSNS_PER_PAGE; i++) { |
133 | if (!kip->slot_used[i]) { | 139 | if (kip->slot_used[i] == SLOT_CLEAN) { |
134 | kip->slot_used[i] = 1; | 140 | kip->slot_used[i] = SLOT_USED; |
135 | kip->nused++; | 141 | kip->nused++; |
136 | return kip->insns + (i * MAX_INSN_SIZE); | 142 | return kip->insns + (i * MAX_INSN_SIZE); |
137 | } | 143 | } |
@@ -163,8 +169,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) | |||
163 | } | 169 | } |
164 | INIT_HLIST_NODE(&kip->hlist); | 170 | INIT_HLIST_NODE(&kip->hlist); |
165 | hlist_add_head(&kip->hlist, &kprobe_insn_pages); | 171 | hlist_add_head(&kip->hlist, &kprobe_insn_pages); |
166 | memset(kip->slot_used, 0, INSNS_PER_PAGE); | 172 | memset(kip->slot_used, SLOT_CLEAN, INSNS_PER_PAGE); |
167 | kip->slot_used[0] = 1; | 173 | kip->slot_used[0] = SLOT_USED; |
168 | kip->nused = 1; | 174 | kip->nused = 1; |
169 | kip->ngarbage = 0; | 175 | kip->ngarbage = 0; |
170 | return kip->insns; | 176 | return kip->insns; |
@@ -173,7 +179,7 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) | |||
173 | /* Return 1 if all garbages are collected, otherwise 0. */ | 179 | /* Return 1 if all garbages are collected, otherwise 0. */ |
174 | static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx) | 180 | static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx) |
175 | { | 181 | { |
176 | kip->slot_used[idx] = 0; | 182 | kip->slot_used[idx] = SLOT_CLEAN; |
177 | kip->nused--; | 183 | kip->nused--; |
178 | if (kip->nused == 0) { | 184 | if (kip->nused == 0) { |
179 | /* | 185 | /* |
@@ -212,7 +218,7 @@ static int __kprobes collect_garbage_slots(void) | |||
212 | continue; | 218 | continue; |
213 | kip->ngarbage = 0; /* we will collect all garbages */ | 219 | kip->ngarbage = 0; /* we will collect all garbages */ |
214 | for (i = 0; i < INSNS_PER_PAGE; i++) { | 220 | for (i = 0; i < INSNS_PER_PAGE; i++) { |
215 | if (kip->slot_used[i] == -1 && | 221 | if (kip->slot_used[i] == SLOT_DIRTY && |
216 | collect_one_slot(kip, i)) | 222 | collect_one_slot(kip, i)) |
217 | break; | 223 | break; |
218 | } | 224 | } |
@@ -232,7 +238,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t * slot, int dirty) | |||
232 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { | 238 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { |
233 | int i = (slot - kip->insns) / MAX_INSN_SIZE; | 239 | int i = (slot - kip->insns) / MAX_INSN_SIZE; |
234 | if (dirty) { | 240 | if (dirty) { |
235 | kip->slot_used[i] = -1; | 241 | kip->slot_used[i] = SLOT_DIRTY; |
236 | kip->ngarbage++; | 242 | kip->ngarbage++; |
237 | } else { | 243 | } else { |
238 | collect_one_slot(kip, i); | 244 | collect_one_slot(kip, i); |
diff --git a/kernel/pid.c b/kernel/pid.c index 2efe9d8d36..78f2aee90f 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -197,7 +197,7 @@ fastcall void free_pid(struct pid *pid) | |||
197 | hlist_del_rcu(&pid->pid_chain); | 197 | hlist_del_rcu(&pid->pid_chain); |
198 | spin_unlock_irqrestore(&pidmap_lock, flags); | 198 | spin_unlock_irqrestore(&pidmap_lock, flags); |
199 | 199 | ||
200 | free_pidmap(current->nsproxy->pid_ns, pid->nr); | 200 | free_pidmap(&init_pid_ns, pid->nr); |
201 | call_rcu(&pid->rcu, delayed_put_pid); | 201 | call_rcu(&pid->rcu, delayed_put_pid); |
202 | } | 202 | } |
203 | 203 | ||
diff --git a/kernel/profile.c b/kernel/profile.c index a6574a1851..d6579d5110 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -331,7 +331,6 @@ out: | |||
331 | local_irq_restore(flags); | 331 | local_irq_restore(flags); |
332 | put_cpu(); | 332 | put_cpu(); |
333 | } | 333 | } |
334 | EXPORT_SYMBOL_GPL(profile_hits); | ||
335 | 334 | ||
336 | static int __devinit profile_cpu_callback(struct notifier_block *info, | 335 | static int __devinit profile_cpu_callback(struct notifier_block *info, |
337 | unsigned long action, void *__cpu) | 336 | unsigned long action, void *__cpu) |
@@ -401,6 +400,8 @@ void profile_hits(int type, void *__pc, unsigned int nr_hits) | |||
401 | } | 400 | } |
402 | #endif /* !CONFIG_SMP */ | 401 | #endif /* !CONFIG_SMP */ |
403 | 402 | ||
403 | EXPORT_SYMBOL_GPL(profile_hits); | ||
404 | |||
404 | void profile_tick(int type) | 405 | void profile_tick(int type) |
405 | { | 406 | { |
406 | struct pt_regs *regs = get_irq_regs(); | 407 | struct pt_regs *regs = get_irq_regs(); |
diff --git a/kernel/sys.c b/kernel/sys.c index c7675c1bfd..6e2101dec0 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -323,11 +323,18 @@ EXPORT_SYMBOL_GPL(blocking_notifier_chain_unregister); | |||
323 | int blocking_notifier_call_chain(struct blocking_notifier_head *nh, | 323 | int blocking_notifier_call_chain(struct blocking_notifier_head *nh, |
324 | unsigned long val, void *v) | 324 | unsigned long val, void *v) |
325 | { | 325 | { |
326 | int ret; | 326 | int ret = NOTIFY_DONE; |
327 | 327 | ||
328 | down_read(&nh->rwsem); | 328 | /* |
329 | ret = notifier_call_chain(&nh->head, val, v); | 329 | * We check the head outside the lock, but if this access is |
330 | up_read(&nh->rwsem); | 330 | * racy then it does not matter what the result of the test |
331 | * is, we re-check the list after having taken the lock anyway: | ||
332 | */ | ||
333 | if (rcu_dereference(nh->head)) { | ||
334 | down_read(&nh->rwsem); | ||
335 | ret = notifier_call_chain(&nh->head, val, v); | ||
336 | up_read(&nh->rwsem); | ||
337 | } | ||
331 | return ret; | 338 | return ret; |
332 | } | 339 | } |
333 | 340 | ||