From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361Ab1ITOVE (ORCPT ); Tue, 20 Sep 2011 10:21:04 -0400 Received: from zene.cmpxchg.org ([85.214.230.12]:54009 "EHLO zene.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777Ab1ITOVC (ORCPT ); Tue, 20 Sep 2011 10:21:02 -0400 Date: Tue, 20 Sep 2011 16:20:31 +0200 From: Johannes Weiner To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Christoph Lameter , Greg Thelen , KAMEZAWA Hiroyuki , Balbir Singh , Daisuke Nishimura Subject: Re: [RFC][PATCH 3/5] memcg: Disable preemption in memcg_check_events() Message-ID: <20110920142031.GB17198@cmpxchg.org> References: <20110919212040.745370781@goodmis.org> <20110919212641.015320989@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110919212641.015320989@goodmis.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 19, 2011 at 05:20:43PM -0400, Steven Rostedt wrote: > From: Steven Rostedt > > 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. Makes sense, thanks! Since the atomic versions are no longer required with preemption disabled explicitely, could you also make the this_cpu ops in __memcg_event_check and __mem_cgroup_target_update non-atomic in the same go?