Commit 51dad801 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: do not hurt SCHED_BATCH on wakeup
  sched: touch softlockup watchdog after idling
  sched: sysctl, proc_dointvec_minmax() expects int values for
  sched: mark rwsem functions as __sched for wchan/profiling
  sched: fix crash on ia64, introduce task_current()
parents 3c615e19 6cbf1c12
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/rwsem.h> #include <linux/rwsem.h>
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
/* /*
* lock for reading * lock for reading
*/ */
void down_read(struct rw_semaphore *sem) void __sched down_read(struct rw_semaphore *sem)
{ {
might_sleep(); might_sleep();
rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_); rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_);
...@@ -42,7 +43,7 @@ EXPORT_SYMBOL(down_read_trylock); ...@@ -42,7 +43,7 @@ EXPORT_SYMBOL(down_read_trylock);
/* /*
* lock for writing * lock for writing
*/ */
void down_write(struct rw_semaphore *sem) void __sched down_write(struct rw_semaphore *sem)
{ {
might_sleep(); might_sleep();
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_); rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
......
...@@ -508,10 +508,15 @@ EXPORT_SYMBOL_GPL(cpu_clock); ...@@ -508,10 +508,15 @@ EXPORT_SYMBOL_GPL(cpu_clock);
# define finish_arch_switch(prev) do { } while (0) # define finish_arch_switch(prev) do { } while (0)
#endif #endif
static inline int task_current(struct rq *rq, struct task_struct *p)
{
return rq->curr == p;
}
#ifndef __ARCH_WANT_UNLOCKED_CTXSW #ifndef __ARCH_WANT_UNLOCKED_CTXSW
static inline int task_running(struct rq *rq, struct task_struct *p) static inline int task_running(struct rq *rq, struct task_struct *p)
{ {
return rq->curr == p; return task_current(rq, p);
} }
static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next) 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,7 +545,7 @@ static inline int task_running(struct rq *rq, struct task_struct *p)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
return p->oncpu; return p->oncpu;
#else #else
return rq->curr == p; return task_current(rq, p);
#endif #endif
} }
...@@ -663,6 +668,7 @@ void sched_clock_idle_wakeup_event(u64 delta_ns) ...@@ -663,6 +668,7 @@ void sched_clock_idle_wakeup_event(u64 delta_ns)
struct rq *rq = cpu_rq(smp_processor_id()); struct rq *rq = cpu_rq(smp_processor_id());
u64 now = sched_clock(); u64 now = sched_clock();
touch_softlockup_watchdog();
rq->idle_clock += delta_ns; rq->idle_clock += delta_ns;
/* /*
* Override the previous timestamp and ignore all * Override the previous timestamp and ignore all
...@@ -3334,7 +3340,7 @@ unsigned long long task_sched_runtime(struct task_struct *p) ...@@ -3334,7 +3340,7 @@ unsigned long long task_sched_runtime(struct task_struct *p)
rq = task_rq_lock(p, &flags); rq = task_rq_lock(p, &flags);
ns = p->se.sum_exec_runtime; ns = p->se.sum_exec_runtime;
if (rq->curr == p) { if (task_current(rq, p)) {
update_rq_clock(rq); update_rq_clock(rq);
delta_exec = rq->clock - p->se.exec_start; delta_exec = rq->clock - p->se.exec_start;
if ((s64)delta_exec > 0) if ((s64)delta_exec > 0)
...@@ -4021,7 +4027,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio) ...@@ -4021,7 +4027,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
oldprio = p->prio; oldprio = p->prio;
on_rq = p->se.on_rq; on_rq = p->se.on_rq;
running = task_running(rq, p); running = task_current(rq, p);
if (on_rq) { if (on_rq) {
dequeue_task(rq, p, 0); dequeue_task(rq, p, 0);
if (running) if (running)
...@@ -4332,7 +4338,7 @@ int sched_setscheduler(struct task_struct *p, int policy, ...@@ -4332,7 +4338,7 @@ int sched_setscheduler(struct task_struct *p, int policy,
} }
update_rq_clock(rq); update_rq_clock(rq);
on_rq = p->se.on_rq; on_rq = p->se.on_rq;
running = task_running(rq, p); running = task_current(rq, p);
if (on_rq) { if (on_rq) {
deactivate_task(rq, p, 0); deactivate_task(rq, p, 0);
if (running) if (running)
...@@ -7101,7 +7107,7 @@ void sched_move_task(struct task_struct *tsk) ...@@ -7101,7 +7107,7 @@ void sched_move_task(struct task_struct *tsk)
update_rq_clock(rq); update_rq_clock(rq);
running = task_running(rq, tsk); running = task_current(rq, tsk);
on_rq = tsk->se.on_rq; on_rq = tsk->se.on_rq;
if (on_rq) { if (on_rq) {
......
...@@ -511,8 +511,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) ...@@ -511,8 +511,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
if (!initial) { if (!initial) {
/* sleeps upto a single latency don't count. */ /* sleeps upto a single latency don't count. */
if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) && if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se))
task_of(se)->policy != SCHED_BATCH)
vruntime -= sysctl_sched_latency; vruntime -= sysctl_sched_latency;
/* ensure we never gain time by being placed backwards. */ /* ensure we never gain time by being placed backwards. */
......
...@@ -225,10 +225,10 @@ static struct ctl_table root_table[] = { ...@@ -225,10 +225,10 @@ static struct ctl_table root_table[] = {
}; };
#ifdef CONFIG_SCHED_DEBUG #ifdef CONFIG_SCHED_DEBUG
static unsigned long min_sched_granularity_ns = 100000; /* 100 usecs */ static int min_sched_granularity_ns = 100000; /* 100 usecs */
static unsigned long max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
static unsigned long min_wakeup_granularity_ns; /* 0 usecs */ static int min_wakeup_granularity_ns; /* 0 usecs */
static unsigned long max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
#endif #endif
static struct ctl_table kern_table[] = { static struct ctl_table kern_table[] = {
......
...@@ -146,7 +146,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) ...@@ -146,7 +146,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
/* /*
* wait for a lock to be granted * wait for a lock to be granted
*/ */
static struct rw_semaphore * static struct rw_semaphore __sched *
rwsem_down_failed_common(struct rw_semaphore *sem, rwsem_down_failed_common(struct rw_semaphore *sem,
struct rwsem_waiter *waiter, signed long adjustment) struct rwsem_waiter *waiter, signed long adjustment)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment