diff options
Diffstat (limited to 'kernel')
-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/sysctl.c | 8 |
4 files changed, 20 insertions, 14 deletions
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/sysctl.c b/kernel/sysctl.c index 1135de730872..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[] = { |