Re: [PATCH] memcg: Fix race condition in memcg_check_events() withthis_cpu usage

From: Balbir Singh
Date: Tue Sep 27 2011 - 06:21:36 EST


On Sat, Sep 24, 2011 at 8:11 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Fri, 2011-09-23 at 19:39 -0700, Greg Thelen wrote:
>> cc: updated Balbir Singh email address
>>
>> On Fri, Sep 23, 2011 at 7:34 PM, Greg Thelen <gthelen@xxxxxxxxxx> wrote:
>> > On Fri, Sep 23, 2011 at 5:54 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>> >> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>> >>
>> >> The code in memcg_check_events() calls this_cpu_read() on
>> >> different variables without disabling preemption, and can cause
>> >> the calculations to be done from two different CPU variables.
>> >>
>> >> Disable preemption throughout the check to keep apples and oranges
>> >> from becoming a mixed drink.
>> >>
>> >> [ Added this_cpu to __this_cpu conversion by Johannes ]
>> >>
>> >> Cc: Greg Thelen <gthelen@xxxxxxxxxx>
>> >> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
>> >> Cc: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx>
>>
>> Correction:
>> Cc: Balbir Singh <bsingharora@xxxxxxxxx>
>
> Thanks, I was starting to hate that "return mail to sender" thing.
>

Thanks for the correction. The change looks good to me

Acked-by: Balbir Singh <bsingharora@xxxxxxxxx>

Balbir


Balbir Singh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/