diff options
Diffstat (limited to 'kernel/sched/core.c')
| -rw-r--r-- | kernel/sched/core.c | 12 | 
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8705125bb9b1..415ab0268b51 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3573,9 +3573,10 @@ static int _sched_setscheduler(struct task_struct *p, int policy,  	};  	/* -	 * Fixup the legacy SCHED_RESET_ON_FORK hack +	 * Fixup the legacy SCHED_RESET_ON_FORK hack, except if +	 * the policy=-1 was passed by sched_setparam().  	 */ -	if (policy & SCHED_RESET_ON_FORK) { +	if ((policy != -1) && (policy & SCHED_RESET_ON_FORK)) {  		attr.sched_flags |= SCHED_FLAG_RESET_ON_FORK;  		policy &= ~SCHED_RESET_ON_FORK;  		attr.sched_policy = policy; @@ -4162,7 +4163,6 @@ static void __cond_resched(void)  int __sched _cond_resched(void)  { -	rcu_cond_resched();  	if (should_resched()) {  		__cond_resched();  		return 1; @@ -4181,18 +4181,15 @@ EXPORT_SYMBOL(_cond_resched);   */  int __cond_resched_lock(spinlock_t *lock)  { -	bool need_rcu_resched = rcu_should_resched();  	int resched = should_resched();  	int ret = 0;  	lockdep_assert_held(lock); -	if (spin_needbreak(lock) || resched || need_rcu_resched) { +	if (spin_needbreak(lock) || resched) {  		spin_unlock(lock);  		if (resched)  			__cond_resched(); -		else if (unlikely(need_rcu_resched)) -			rcu_resched();  		else  			cpu_relax();  		ret = 1; @@ -4206,7 +4203,6 @@ int __sched __cond_resched_softirq(void)  {  	BUG_ON(!in_softirq()); -	rcu_cond_resched();  /* BH disabled OK, just recording QSes. */  	if (should_resched()) {  		local_bh_enable();  		__cond_resched();  |