mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "Revert "sched: reduce sleep duration in wait_task_inactive()""
This commit is contained in:
commit
8adf183fac
2 changed files with 16 additions and 3 deletions
|
|
@ -199,8 +199,15 @@ static void __kthread_parkme(struct kthread *self)
|
|||
if (!test_bit(KTHREAD_SHOULD_PARK, &self->flags))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Thread is going to call schedule(), do not preempt it,
|
||||
* or the caller of kthread_park() may spend more time in
|
||||
* wait_task_inactive().
|
||||
*/
|
||||
preempt_disable();
|
||||
complete(&self->parked);
|
||||
schedule();
|
||||
schedule_preempt_disabled();
|
||||
preempt_enable();
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
}
|
||||
|
|
@ -245,8 +252,14 @@ static int kthread(void *_create)
|
|||
/* OK, tell user we're spawned, wait for stop or wakeup */
|
||||
__set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
create->result = current;
|
||||
/*
|
||||
* Thread is going to call schedule(), do not preempt it,
|
||||
* or the creator may spend more time in wait_task_inactive().
|
||||
*/
|
||||
preempt_disable();
|
||||
complete(done);
|
||||
schedule();
|
||||
schedule_preempt_disabled();
|
||||
preempt_enable();
|
||||
|
||||
ret = -EINTR;
|
||||
if (!test_bit(KTHREAD_SHOULD_STOP, &self->flags)) {
|
||||
|
|
|
|||
|
|
@ -2008,7 +2008,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
|
|||
* yield - it could be a while.
|
||||
*/
|
||||
if (unlikely(queued)) {
|
||||
ktime_t to = NSEC_PER_MSEC;
|
||||
ktime_t to = NSEC_PER_SEC / HZ;
|
||||
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
schedule_hrtimeout(&to, HRTIMER_MODE_REL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue