Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1429683
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks |
| Date | 2016-06-23 13:20 +0200 |
| Message-ID | <rNaPU-IX-13@gated-at.bofh.it> (permalink) |
| References | <rL0KZ-6mx-9@gated-at.bofh.it> <rL0L0-6mx-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jun 17, 2016 at 02:01:40PM +0200, Peter Zijlstra wrote: > @@ -8219,6 +8254,19 @@ static int cpu_cgroup_can_attach(struct > if (task->sched_class != &fair_sched_class) > return -EINVAL; > #endif > + /* > + * Serialize against wake_up_new_task() such > + * that if its running, we're sure to observe > + * its full state. > + */ > + raw_spin_unlock_wait(&task->pi_lock); > + /* > + * Avoid calling sched_move_task() before wake_up_new_task() > + * has happened. This would lead to problems with PELT. See > + * XXX. > + */ > + if (task->state == TASK_NEW) > + return -EINVAL; > } > return 0; > } So I think that's backwards; we want: if (task->state == TASK_NEW) return -EINVAL; raw_spin_unlock_wait(&task->pi_lock); Because failing the attach is 'safe', but if we do not observe NEW we must be absolutely sure to observe the full wakeup_new. But since its not critical I'll change it to more obvious code: raw_spin_lock_irq(&task->pi_lock); if (task->state == TASK_NEW) ret = -EINVAL; raw_spin_unlock_irq(&task->pi_lock);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] sched/fair: Fix PELT wobblies Peter Zijlstra <peterz@infradead.org> - 2016-06-17 14:10 +0200
[PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-17 14:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-17 16:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-17 16:30 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-17 18:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-17 18:20 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-17 18:20 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Yuyang Du <yuyang.du@intel.com> - 2016-06-20 09:00 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-20 11:30 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-20 12:00 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-20 12:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-21 13:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-21 14:40 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-21 14:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-21 15:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-06-20 14:00 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-20 14:40 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-06-20 17:00 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-21 10:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Yuyang Du <yuyang.du@intel.com> - 2016-06-21 14:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-24 15:10 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-21 15:40 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-22 13:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-21 16:20 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-06-23 17:40 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-23 19:20 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-20 16:50 +0200
Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Peter Zijlstra <peterz@infradead.org> - 2016-06-23 13:20 +0200
[PATCH 2/4] sched/fair: Fix PELT integrity for new groups Peter Zijlstra <peterz@infradead.org> - 2016-06-17 14:10 +0200
Re: [PATCH 2/4] sched/fair: Fix PELT integrity for new groups Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-17 16:00 +0200
[PATCH 3/4] sched,cgroup: Fix cpu_cgroup_fork() Peter Zijlstra <peterz@infradead.org> - 2016-06-17 14:10 +0200
Re: [PATCH 3/4] sched,cgroup: Fix cpu_cgroup_fork() Vincent Guittot <vincent.guittot@linaro.org> - 2016-06-17 16:00 +0200
Re: [PATCH 3/4] sched,cgroup: Fix cpu_cgroup_fork() Peter Zijlstra <peterz@infradead.org> - 2016-06-17 16:10 +0200
csiph-web