Merge branch 'linus' into sched/core
Merge reason: branch had an old upstream base (-rc1-ish), but also merge to avoid a conflict. Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@ -493,6 +493,7 @@ struct rt_rq {
|
||||
#endif
|
||||
#ifdef CONFIG_SMP
|
||||
unsigned long rt_nr_migratory;
|
||||
unsigned long rt_nr_total;
|
||||
int overloaded;
|
||||
struct plist_head pushable_tasks;
|
||||
#endif
|
||||
@ -2572,15 +2573,37 @@ static void __sched_fork(struct task_struct *p)
|
||||
p->se.avg_wakeup = sysctl_sched_wakeup_granularity;
|
||||
|
||||
#ifdef CONFIG_SCHEDSTATS
|
||||
p->se.wait_start = 0;
|
||||
p->se.sum_sleep_runtime = 0;
|
||||
p->se.sleep_start = 0;
|
||||
p->se.block_start = 0;
|
||||
p->se.sleep_max = 0;
|
||||
p->se.block_max = 0;
|
||||
p->se.exec_max = 0;
|
||||
p->se.slice_max = 0;
|
||||
p->se.wait_max = 0;
|
||||
p->se.wait_start = 0;
|
||||
p->se.wait_max = 0;
|
||||
p->se.wait_count = 0;
|
||||
p->se.wait_sum = 0;
|
||||
|
||||
p->se.sleep_start = 0;
|
||||
p->se.sleep_max = 0;
|
||||
p->se.sum_sleep_runtime = 0;
|
||||
|
||||
p->se.block_start = 0;
|
||||
p->se.block_max = 0;
|
||||
p->se.exec_max = 0;
|
||||
p->se.slice_max = 0;
|
||||
|
||||
p->se.nr_migrations_cold = 0;
|
||||
p->se.nr_failed_migrations_affine = 0;
|
||||
p->se.nr_failed_migrations_running = 0;
|
||||
p->se.nr_failed_migrations_hot = 0;
|
||||
p->se.nr_forced_migrations = 0;
|
||||
p->se.nr_forced2_migrations = 0;
|
||||
|
||||
p->se.nr_wakeups = 0;
|
||||
p->se.nr_wakeups_sync = 0;
|
||||
p->se.nr_wakeups_migrate = 0;
|
||||
p->se.nr_wakeups_local = 0;
|
||||
p->se.nr_wakeups_remote = 0;
|
||||
p->se.nr_wakeups_affine = 0;
|
||||
p->se.nr_wakeups_affine_attempts = 0;
|
||||
p->se.nr_wakeups_passive = 0;
|
||||
p->se.nr_wakeups_idle = 0;
|
||||
|
||||
#endif
|
||||
|
||||
INIT_LIST_HEAD(&p->rt.run_list);
|
||||
@ -6580,6 +6603,11 @@ SYSCALL_DEFINE0(sched_yield)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int should_resched(void)
|
||||
{
|
||||
return need_resched() && !(preempt_count() & PREEMPT_ACTIVE);
|
||||
}
|
||||
|
||||
static void __cond_resched(void)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
|
||||
@ -6599,8 +6627,7 @@ static void __cond_resched(void)
|
||||
|
||||
int __sched _cond_resched(void)
|
||||
{
|
||||
if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) &&
|
||||
system_state == SYSTEM_RUNNING) {
|
||||
if (should_resched()) {
|
||||
__cond_resched();
|
||||
return 1;
|
||||
}
|
||||
@ -6618,12 +6645,12 @@ EXPORT_SYMBOL(_cond_resched);
|
||||
*/
|
||||
int cond_resched_lock(spinlock_t *lock)
|
||||
{
|
||||
int resched = need_resched() && system_state == SYSTEM_RUNNING;
|
||||
int resched = should_resched();
|
||||
int ret = 0;
|
||||
|
||||
if (spin_needbreak(lock) || resched) {
|
||||
spin_unlock(lock);
|
||||
if (resched && need_resched())
|
||||
if (resched)
|
||||
__cond_resched();
|
||||
else
|
||||
cpu_relax();
|
||||
@ -6638,7 +6665,7 @@ int __sched cond_resched_softirq(void)
|
||||
{
|
||||
BUG_ON(!in_softirq());
|
||||
|
||||
if (need_resched() && system_state == SYSTEM_RUNNING) {
|
||||
if (should_resched()) {
|
||||
local_bh_enable();
|
||||
__cond_resched();
|
||||
local_bh_disable();
|
||||
@ -9109,7 +9136,7 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
|
||||
#ifdef CONFIG_SMP
|
||||
rt_rq->rt_nr_migratory = 0;
|
||||
rt_rq->overloaded = 0;
|
||||
plist_head_init(&rq->rt.pushable_tasks, &rq->lock);
|
||||
plist_head_init(&rt_rq->pushable_tasks, &rq->lock);
|
||||
#endif
|
||||
|
||||
rt_rq->rt_time = 0;
|
||||
|
Reference in New Issue
Block a user