Re: [RFC][PATCH] sched: Fix race in task_group()

From: Hillf Danton
Date: Wed Jun 27 2012 - 08:40:00 EST


The patch went three versions, the first,

On Fri, Jun 22, 2012 at 7:36 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> Reported-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> ---
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 32157b9..77437d4 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1246,6 +1246,9 @@ struct task_struct {
> const struct sched_class *sched_class;
> struct sched_entity se;
> struct sched_rt_entity rt;
> +#ifdef CONFIG_CGROUP_SCHED
> + struct task_struct *sched_task_group;
> +#endif
>

The second,

>> On 26.06.2012 15:48, Peter Zijlstra wrote:
>> Here's one that's actually compile tested (with the right CONFIG_foo
>> enabled) and I fixed the autogroup lockdep splat.
>>
>> ---
>> Subject: sched: Fix race in task_group()
>> From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
>> Date: Fri, 22 Jun 2012 13:36:05 +0200
>>
>> Reported-by: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
>> Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
>> ---
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -1246,6 +1246,9 @@ struct task_struct {
>> Â Â Â const struct sched_class *sched_class;
>> Â Â Â struct sched_entity se;
>> Â Â Â struct sched_rt_entity rt;
>> +#ifdef CONFIG_CGROUP_SCHED
>> + Â Â struct task_group *sched_task_group;
>> +#endif
>>

And the third, https://lkml.org/lkml/2012/6/26/331