[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1316825188.6387.1.camel@gandalf.stny.rr.com>
Date: Fri, 23 Sep 2011 20:46:25 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Christoph Lameter <cl@...ux.com>,
Johannes Weiner <hannes@...xchg.org>,
Greg Thelen <gthelen@...gle.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Daisuke Nishimura <nishimura@....nes.nec.co.jp>
Subject: Re: [RFC][PATCH 3/5] memcg: Disable preemption in
memcg_check_events()
On Mon, 2011-09-19 at 17:20 -0400, Steven Rostedt wrote:
> plain text document attachment
> (0003-memcg-Disable-preemption-in-memcg_check_events.patch)
> From: Steven Rostedt <srostedt@...hat.com>
>
> 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.
>
> Signed-off-by: Johannes Weiner <hannes@...xchg.org>
> Signed-off-by: Greg Thelen <gthelen@...gle.com>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> Acked-by: Balbir Singh <balbir@...ux.vnet.ibm.com>
Oops, I just noticed that I cut and pasted from another commit and was
suppose to change these to Cc's as all the above (except Johannes) did
not give their ack or sob.
I'll merge in Johannes's changes and push out a patch for someone to
take.
Thanks,
-- Steve
> Cc: Daisuke Nishimura <nishimura@....nes.nec.co.jp>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
> mm/memcontrol.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3508777..a164c93 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -718,6 +718,7 @@ static void __mem_cgroup_target_update(struct mem_cgroup *mem, int target)
> */
> static void memcg_check_events(struct mem_cgroup *mem, struct page *page)
> {
> + preempt_disable();
> /* threshold event is triggered in finer grain than soft limit */
> if (unlikely(__memcg_event_check(mem, MEM_CGROUP_TARGET_THRESH))) {
> mem_cgroup_threshold(mem);
> @@ -737,6 +738,7 @@ static void memcg_check_events(struct mem_cgroup *mem, struct page *page)
> }
> #endif
> }
> + preempt_enable();
> }
>
> static struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists