diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/chip.c | 9 | ||||
-rw-r--r-- | kernel/panic.c | 18 | ||||
-rw-r--r-- | kernel/rwsem.c | 5 | ||||
-rw-r--r-- | kernel/sched.c | 18 | ||||
-rw-r--r-- | kernel/sched_fair.c | 3 | ||||
-rw-r--r-- | kernel/sched_rt.c | 2 | ||||
-rw-r--r-- | kernel/sysctl.c | 16 | ||||
-rw-r--r-- | kernel/sysctl_check.c | 7 | ||||
-rw-r--r-- | kernel/time/tick-broadcast.c | 56 | ||||
-rw-r--r-- | kernel/timer.c | 4 |
10 files changed, 75 insertions, 63 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 9b5dff6b3f6a..44019ce30a14 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -297,18 +297,13 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc) | |||
297 | 297 | ||
298 | if (unlikely(desc->status & IRQ_INPROGRESS)) | 298 | if (unlikely(desc->status & IRQ_INPROGRESS)) |
299 | goto out_unlock; | 299 | goto out_unlock; |
300 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | ||
300 | kstat_cpu(cpu).irqs[irq]++; | 301 | kstat_cpu(cpu).irqs[irq]++; |
301 | 302 | ||
302 | action = desc->action; | 303 | action = desc->action; |
303 | if (unlikely(!action || (desc->status & IRQ_DISABLED))) { | 304 | if (unlikely(!action || (desc->status & IRQ_DISABLED))) |
304 | if (desc->chip->mask) | ||
305 | desc->chip->mask(irq); | ||
306 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | ||
307 | desc->status |= IRQ_PENDING; | ||
308 | goto out_unlock; | 305 | goto out_unlock; |
309 | } | ||
310 | 306 | ||
311 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING | IRQ_PENDING); | ||
312 | desc->status |= IRQ_INPROGRESS; | 307 | desc->status |= IRQ_INPROGRESS; |
313 | spin_unlock(&desc->lock); | 308 | spin_unlock(&desc->lock); |
314 | 309 | ||
diff --git a/kernel/panic.c b/kernel/panic.c index 6f6e03e91595..da4d6bac270e 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/nmi.h> | 19 | #include <linux/nmi.h> |
20 | #include <linux/kexec.h> | 20 | #include <linux/kexec.h> |
21 | #include <linux/debug_locks.h> | 21 | #include <linux/debug_locks.h> |
22 | #include <linux/random.h> | ||
22 | 23 | ||
23 | int panic_on_oops; | 24 | int panic_on_oops; |
24 | int tainted; | 25 | int tainted; |
@@ -266,12 +267,29 @@ void oops_enter(void) | |||
266 | } | 267 | } |
267 | 268 | ||
268 | /* | 269 | /* |
270 | * 64-bit random ID for oopses: | ||
271 | */ | ||
272 | static u64 oops_id; | ||
273 | |||
274 | static int init_oops_id(void) | ||
275 | { | ||
276 | if (!oops_id) | ||
277 | get_random_bytes(&oops_id, sizeof(oops_id)); | ||
278 | |||
279 | return 0; | ||
280 | } | ||
281 | late_initcall(init_oops_id); | ||
282 | |||
283 | /* | ||
269 | * Called when the architecture exits its oops handler, after printing | 284 | * Called when the architecture exits its oops handler, after printing |
270 | * everything. | 285 | * everything. |
271 | */ | 286 | */ |
272 | void oops_exit(void) | 287 | void oops_exit(void) |
273 | { | 288 | { |
274 | do_oops_enter_exit(); | 289 | do_oops_enter_exit(); |
290 | init_oops_id(); | ||
291 | printk(KERN_WARNING "---[ end trace %016llx ]---\n", | ||
292 | (unsigned long long)oops_id); | ||
275 | } | 293 | } |
276 | 294 | ||
277 | #ifdef CONFIG_CC_STACKPROTECTOR | 295 | #ifdef CONFIG_CC_STACKPROTECTOR |
diff --git a/kernel/rwsem.c b/kernel/rwsem.c index 1ec620c03064..cae050b05f5e 100644 --- a/kernel/rwsem.c +++ b/kernel/rwsem.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/sched.h> | ||
9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
10 | #include <linux/rwsem.h> | 11 | #include <linux/rwsem.h> |
11 | 12 | ||
@@ -15,7 +16,7 @@ | |||
15 | /* | 16 | /* |
16 | * lock for reading | 17 | * lock for reading |
17 | */ | 18 | */ |
18 | void down_read(struct rw_semaphore *sem) | 19 | void __sched down_read(struct rw_semaphore *sem) |
19 | { | 20 | { |
20 | might_sleep(); | 21 | might_sleep(); |
21 | rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_); | 22 | rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_); |
@@ -42,7 +43,7 @@ EXPORT_SYMBOL(down_read_trylock); | |||
42 | /* | 43 | /* |
43 | * lock for writing | 44 | * lock for writing |
44 | */ | 45 | */ |
45 | void down_write(struct rw_semaphore *sem) | 46 | void __sched down_write(struct rw_semaphore *sem) |
46 | { | 47 | { |
47 | might_sleep(); | 48 | might_sleep(); |
48 | rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_); | 49 | rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_); |
diff --git a/kernel/sched.c b/kernel/sched.c index c6e551de795b..3df84ea6aba9 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -508,10 +508,15 @@ EXPORT_SYMBOL_GPL(cpu_clock); | |||
508 | # define finish_arch_switch(prev) do { } while (0) | 508 | # define finish_arch_switch(prev) do { } while (0) |
509 | #endif | 509 | #endif |
510 | 510 | ||
511 | static inline int task_current(struct rq *rq, struct task_struct *p) | ||
512 | { | ||
513 | return rq->curr == p; | ||
514 | } | ||
515 | |||
511 | #ifndef __ARCH_WANT_UNLOCKED_CTXSW | 516 | #ifndef __ARCH_WANT_UNLOCKED_CTXSW |
512 | static inline int task_running(struct rq *rq, struct task_struct *p) | 517 | static inline int task_running(struct rq *rq, struct task_struct *p) |
513 | { | 518 | { |
514 | return rq->curr == p; | 519 | return task_current(rq, p); |
515 | } | 520 | } |
516 | 521 | ||
517 | static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next) | 522 | static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next) |
@@ -540,7 +545,7 @@ static inline int task_running(struct rq *rq, struct task_struct *p) | |||
540 | #ifdef CONFIG_SMP | 545 | #ifdef CONFIG_SMP |
541 | return p->oncpu; | 546 | return p->oncpu; |
542 | #else | 547 | #else |
543 | return rq->curr == p; | 548 | return task_current(rq, p); |
544 | #endif | 549 | #endif |
545 | } | 550 | } |
546 | 551 | ||
@@ -663,6 +668,7 @@ void sched_clock_idle_wakeup_event(u64 delta_ns) | |||
663 | struct rq *rq = cpu_rq(smp_processor_id()); | 668 | struct rq *rq = cpu_rq(smp_processor_id()); |
664 | u64 now = sched_clock(); | 669 | u64 now = sched_clock(); |
665 | 670 | ||
671 | touch_softlockup_watchdog(); | ||
666 | rq->idle_clock += delta_ns; | 672 | rq->idle_clock += delta_ns; |
667 | /* | 673 | /* |
668 | * Override the previous timestamp and ignore all | 674 | * Override the previous timestamp and ignore all |
@@ -3334,7 +3340,7 @@ unsigned long long task_sched_runtime(struct task_struct *p) | |||
3334 | 3340 | ||
3335 | rq = task_rq_lock(p, &flags); | 3341 | rq = task_rq_lock(p, &flags); |
3336 | ns = p->se.sum_exec_runtime; | 3342 | ns = p->se.sum_exec_runtime; |
3337 | if (rq->curr == p) { | 3343 | if (task_current(rq, p)) { |
3338 | update_rq_clock(rq); | 3344 | update_rq_clock(rq); |
3339 | delta_exec = rq->clock - p->se.exec_start; | 3345 | delta_exec = rq->clock - p->se.exec_start; |
3340 | if ((s64)delta_exec > 0) | 3346 | if ((s64)delta_exec > 0) |
@@ -4021,7 +4027,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio) | |||
4021 | 4027 | ||
4022 | oldprio = p->prio; | 4028 | oldprio = p->prio; |
4023 | on_rq = p->se.on_rq; | 4029 | on_rq = p->se.on_rq; |
4024 | running = task_running(rq, p); | 4030 | running = task_current(rq, p); |
4025 | if (on_rq) { | 4031 | if (on_rq) { |
4026 | dequeue_task(rq, p, 0); | 4032 | dequeue_task(rq, p, 0); |
4027 | if (running) | 4033 | if (running) |
@@ -4332,7 +4338,7 @@ recheck: | |||
4332 | } | 4338 | } |
4333 | update_rq_clock(rq); | 4339 | update_rq_clock(rq); |
4334 | on_rq = p->se.on_rq; | 4340 | on_rq = p->se.on_rq; |
4335 | running = task_running(rq, p); | 4341 | running = task_current(rq, p); |
4336 | if (on_rq) { | 4342 | if (on_rq) { |
4337 | deactivate_task(rq, p, 0); | 4343 | deactivate_task(rq, p, 0); |
4338 | if (running) | 4344 | if (running) |
@@ -7101,7 +7107,7 @@ void sched_move_task(struct task_struct *tsk) | |||
7101 | 7107 | ||
7102 | update_rq_clock(rq); | 7108 | update_rq_clock(rq); |
7103 | 7109 | ||
7104 | running = task_running(rq, tsk); | 7110 | running = task_current(rq, tsk); |
7105 | on_rq = tsk->se.on_rq; | 7111 | on_rq = tsk->se.on_rq; |
7106 | 7112 | ||
7107 | if (on_rq) { | 7113 | if (on_rq) { |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index c33f0ceb3de9..da7c061e7206 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -511,8 +511,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) | |||
511 | 511 | ||
512 | if (!initial) { | 512 | if (!initial) { |
513 | /* sleeps upto a single latency don't count. */ | 513 | /* sleeps upto a single latency don't count. */ |
514 | if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) && | 514 | if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se)) |
515 | task_of(se)->policy != SCHED_BATCH) | ||
516 | vruntime -= sysctl_sched_latency; | 515 | vruntime -= sysctl_sched_latency; |
517 | 516 | ||
518 | /* ensure we never gain time by being placed backwards. */ | 517 | /* ensure we never gain time by being placed backwards. */ |
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index ee9c8b6529e9..9ba3daa03475 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -208,6 +208,8 @@ move_one_task_rt(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
208 | 208 | ||
209 | static void task_tick_rt(struct rq *rq, struct task_struct *p) | 209 | static void task_tick_rt(struct rq *rq, struct task_struct *p) |
210 | { | 210 | { |
211 | update_curr_rt(rq); | ||
212 | |||
211 | /* | 213 | /* |
212 | * RR tasks need a special form of timeslice management. | 214 | * RR tasks need a special form of timeslice management. |
213 | * FIFO tasks have no timeslices. | 215 | * FIFO tasks have no timeslices. |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 8ac51714b08c..c68f68dcc605 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -225,10 +225,10 @@ static struct ctl_table root_table[] = { | |||
225 | }; | 225 | }; |
226 | 226 | ||
227 | #ifdef CONFIG_SCHED_DEBUG | 227 | #ifdef CONFIG_SCHED_DEBUG |
228 | static unsigned long min_sched_granularity_ns = 100000; /* 100 usecs */ | 228 | static int min_sched_granularity_ns = 100000; /* 100 usecs */ |
229 | static unsigned long max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 229 | static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
230 | static unsigned long min_wakeup_granularity_ns; /* 0 usecs */ | 230 | static int min_wakeup_granularity_ns; /* 0 usecs */ |
231 | static unsigned long max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | 231 | static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
232 | #endif | 232 | #endif |
233 | 233 | ||
234 | static struct ctl_table kern_table[] = { | 234 | static struct ctl_table kern_table[] = { |
@@ -906,11 +906,11 @@ static struct ctl_table vm_table[] = { | |||
906 | }, | 906 | }, |
907 | { | 907 | { |
908 | .ctl_name = CTL_UNNUMBERED, | 908 | .ctl_name = CTL_UNNUMBERED, |
909 | .procname = "hugetlb_dynamic_pool", | 909 | .procname = "nr_overcommit_hugepages", |
910 | .data = &hugetlb_dynamic_pool, | 910 | .data = &nr_overcommit_huge_pages, |
911 | .maxlen = sizeof(hugetlb_dynamic_pool), | 911 | .maxlen = sizeof(nr_overcommit_huge_pages), |
912 | .mode = 0644, | 912 | .mode = 0644, |
913 | .proc_handler = &proc_dointvec, | 913 | .proc_handler = &proc_doulongvec_minmax, |
914 | }, | 914 | }, |
915 | #endif | 915 | #endif |
916 | { | 916 | { |
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index bed939f82c31..a68425a5cc1d 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c | |||
@@ -428,7 +428,7 @@ static struct trans_ctl_table trans_net_netrom_table[] = { | |||
428 | {} | 428 | {} |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static struct trans_ctl_table trans_net_ax25_table[] = { | 431 | static struct trans_ctl_table trans_net_ax25_param_table[] = { |
432 | { NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, | 432 | { NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" }, |
433 | { NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, | 433 | { NET_AX25_DEFAULT_MODE, "ax25_default_mode" }, |
434 | { NET_AX25_BACKOFF_TYPE, "backoff_type" }, | 434 | { NET_AX25_BACKOFF_TYPE, "backoff_type" }, |
@@ -446,6 +446,11 @@ static struct trans_ctl_table trans_net_ax25_table[] = { | |||
446 | {} | 446 | {} |
447 | }; | 447 | }; |
448 | 448 | ||
449 | static struct trans_ctl_table trans_net_ax25_table[] = { | ||
450 | { 0, NULL, trans_net_ax25_param_table }, | ||
451 | {} | ||
452 | }; | ||
453 | |||
449 | static struct trans_ctl_table trans_net_bridge_table[] = { | 454 | static struct trans_ctl_table trans_net_bridge_table[] = { |
450 | { NET_BRIDGE_NF_CALL_ARPTABLES, "bridge-nf-call-arptables" }, | 455 | { NET_BRIDGE_NF_CALL_ARPTABLES, "bridge-nf-call-arptables" }, |
451 | { NET_BRIDGE_NF_CALL_IPTABLES, "bridge-nf-call-iptables" }, | 456 | { NET_BRIDGE_NF_CALL_IPTABLES, "bridge-nf-call-iptables" }, |
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index aa82d7bf478a..5b86698faa0b 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -384,45 +384,19 @@ int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | |||
384 | } | 384 | } |
385 | 385 | ||
386 | /* | 386 | /* |
387 | * Reprogram the broadcast device: | ||
388 | * | ||
389 | * Called with tick_broadcast_lock held and interrupts disabled. | ||
390 | */ | ||
391 | static int tick_broadcast_reprogram(void) | ||
392 | { | ||
393 | ktime_t expires = { .tv64 = KTIME_MAX }; | ||
394 | struct tick_device *td; | ||
395 | int cpu; | ||
396 | |||
397 | /* | ||
398 | * Find the event which expires next: | ||
399 | */ | ||
400 | for (cpu = first_cpu(tick_broadcast_oneshot_mask); cpu != NR_CPUS; | ||
401 | cpu = next_cpu(cpu, tick_broadcast_oneshot_mask)) { | ||
402 | td = &per_cpu(tick_cpu_device, cpu); | ||
403 | if (td->evtdev->next_event.tv64 < expires.tv64) | ||
404 | expires = td->evtdev->next_event; | ||
405 | } | ||
406 | |||
407 | if (expires.tv64 == KTIME_MAX) | ||
408 | return 0; | ||
409 | |||
410 | return tick_broadcast_set_event(expires, 0); | ||
411 | } | ||
412 | |||
413 | /* | ||
414 | * Handle oneshot mode broadcasting | 387 | * Handle oneshot mode broadcasting |
415 | */ | 388 | */ |
416 | static void tick_handle_oneshot_broadcast(struct clock_event_device *dev) | 389 | static void tick_handle_oneshot_broadcast(struct clock_event_device *dev) |
417 | { | 390 | { |
418 | struct tick_device *td; | 391 | struct tick_device *td; |
419 | cpumask_t mask; | 392 | cpumask_t mask; |
420 | ktime_t now; | 393 | ktime_t now, next_event; |
421 | int cpu; | 394 | int cpu; |
422 | 395 | ||
423 | spin_lock(&tick_broadcast_lock); | 396 | spin_lock(&tick_broadcast_lock); |
424 | again: | 397 | again: |
425 | dev->next_event.tv64 = KTIME_MAX; | 398 | dev->next_event.tv64 = KTIME_MAX; |
399 | next_event.tv64 = KTIME_MAX; | ||
426 | mask = CPU_MASK_NONE; | 400 | mask = CPU_MASK_NONE; |
427 | now = ktime_get(); | 401 | now = ktime_get(); |
428 | /* Find all expired events */ | 402 | /* Find all expired events */ |
@@ -431,19 +405,31 @@ again: | |||
431 | td = &per_cpu(tick_cpu_device, cpu); | 405 | td = &per_cpu(tick_cpu_device, cpu); |
432 | if (td->evtdev->next_event.tv64 <= now.tv64) | 406 | if (td->evtdev->next_event.tv64 <= now.tv64) |
433 | cpu_set(cpu, mask); | 407 | cpu_set(cpu, mask); |
408 | else if (td->evtdev->next_event.tv64 < next_event.tv64) | ||
409 | next_event.tv64 = td->evtdev->next_event.tv64; | ||
434 | } | 410 | } |
435 | 411 | ||
436 | /* | 412 | /* |
437 | * Wakeup the cpus which have an expired event. The broadcast | 413 | * Wakeup the cpus which have an expired event. |
438 | * device is reprogrammed in the return from idle code. | 414 | */ |
415 | tick_do_broadcast(mask); | ||
416 | |||
417 | /* | ||
418 | * Two reasons for reprogram: | ||
419 | * | ||
420 | * - The global event did not expire any CPU local | ||
421 | * events. This happens in dyntick mode, as the maximum PIT | ||
422 | * delta is quite small. | ||
423 | * | ||
424 | * - There are pending events on sleeping CPUs which were not | ||
425 | * in the event mask | ||
439 | */ | 426 | */ |
440 | if (!tick_do_broadcast(mask)) { | 427 | if (next_event.tv64 != KTIME_MAX) { |
441 | /* | 428 | /* |
442 | * The global event did not expire any CPU local | 429 | * Rearm the broadcast device. If event expired, |
443 | * events. This happens in dyntick mode, as the | 430 | * repeat the above |
444 | * maximum PIT delta is quite small. | ||
445 | */ | 431 | */ |
446 | if (tick_broadcast_reprogram()) | 432 | if (tick_broadcast_set_event(next_event, 0)) |
447 | goto again; | 433 | goto again; |
448 | } | 434 | } |
449 | spin_unlock(&tick_broadcast_lock); | 435 | spin_unlock(&tick_broadcast_lock); |
diff --git a/kernel/timer.c b/kernel/timer.c index a05817c021d6..d4527dcef1af 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1219,11 +1219,11 @@ asmlinkage long sys_sysinfo(struct sysinfo __user *info) | |||
1219 | */ | 1219 | */ |
1220 | static struct lock_class_key base_lock_keys[NR_CPUS]; | 1220 | static struct lock_class_key base_lock_keys[NR_CPUS]; |
1221 | 1221 | ||
1222 | static int __devinit init_timers_cpu(int cpu) | 1222 | static int __cpuinit init_timers_cpu(int cpu) |
1223 | { | 1223 | { |
1224 | int j; | 1224 | int j; |
1225 | tvec_base_t *base; | 1225 | tvec_base_t *base; |
1226 | static char __devinitdata tvec_base_done[NR_CPUS]; | 1226 | static char __cpuinitdata tvec_base_done[NR_CPUS]; |
1227 | 1227 | ||
1228 | if (!tvec_base_done[cpu]) { | 1228 | if (!tvec_base_done[cpu]) { |
1229 | static char boot_done; | 1229 | static char boot_done; |