Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1567284
| From | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online() |
| Date | 2017-01-26 11:30 +0100 |
| Message-ID | <t3Ptw-68L-15@gated-at.bofh.it> (permalink) |
| References | <t3OQN-5FW-3@gated-at.bofh.it> <t3PjP-65h-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 26.01.2017 13:17, Peter Zijlstra wrote:
> On Thu, Jan 26, 2017 at 12:41:41PM +0300, Konstantin Khlebnikov wrote:
>> Commit 2f5177f0fd7e ("sched/cgroup: Fix/cleanup cgroup teardown/init") moved
>> sched_online_group() from css_online() to css_alloc(). It exposes half-baked
>> task group into global lists before initializing generic cgroup stuff.
>>
>> LTP testcase (third in cgroup_regression_test) written for testing
>> similar race in kernels 2.6.26-2.6.28 easily triggers this oops:
>>
>
> So nobody's run LTP against the kernel for almost a year?
Yep. Nobody runs LTP =)
CONFIG_RT_GROUP_SCHED must be y (which almost impossible to use IRL, I have some patches for it out of tree)
Also systemd by default binds cgroups cpu and cpuacct together - this breaks testcase.
>
>>
>> Here task group already linked into global RCU-protected list task_groups
>> but pointer css->cgroup is still NULL.
>>
>> This patch reverts this chunk and moves online back to css_online().
>
> Maybe put a comment with it that explains why this is needed?
>
> Something along the lines of this perhaps?
>
Actually online is called before complete initialization. See second patch. =)
I don't know what to do with this. cgroups are messy as always.
> /*
> * Don't expose the cgroup until initialization of it is complete in the
> * cgroup core. Otherwise things like cgroup_path() will return NULL
> * pointers and the like.
> */
>
>> +static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
>> +{
>> + struct task_group *tg = css_tg(css);
>> + struct task_group *parent = css_tg(css->parent);
>> +
>> + if (parent)
>> + sched_online_group(tg, parent);
>> + return 0;
>> +}
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online() Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-01-26 10:50 +0100
[PATCH 2/2] kernfs: define name and path to "(null)" for NULL pointer kernfs nodes Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-01-26 10:50 +0100
Re: [PATCH 2/2] kernfs: define name and path to "(null)" for NULL pointer kernfs nodes Tejun Heo <tj@kernel.org> - 2017-01-26 20:50 +0100
[PATCH cgroup/for-4.10-fixes] cgroup: don't online subsystems before cgroup_name/path() are operational Tejun Heo <tj@kernel.org> - 2017-01-26 23:00 +0100
Re: [PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online() Peter Zijlstra <peterz@infradead.org> - 2017-01-26 11:20 +0100
Re: [PATCH 1/2] sched/cgroup: move sched_online_group() back into css_online() Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-01-26 11:30 +0100
csiph-web