From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by kanga.kvack.org (Postfix) with ESMTP id 4AFE86B0036 for ; Mon, 22 Sep 2014 04:24:19 -0400 (EDT) Received: by mail-pd0-f174.google.com with SMTP id g10so3501132pdj.33 for ; Mon, 22 Sep 2014 01:24:18 -0700 (PDT) Received: from mx2.parallels.com (mx2.parallels.com. [199.115.105.18]) by mx.google.com with ESMTPS id m16si14551155pdn.207.2014.09.22.01.24.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 01:24:18 -0700 (PDT) Date: Mon, 22 Sep 2014 12:24:02 +0400 From: Vladimir Davydov Subject: Re: [patch 1/3] mm: memcontrol: take a css reference for each charged page Message-ID: <20140922082402.GA18526@esperanza> References: <1411243235-24680-1-git-send-email-hannes@cmpxchg.org> <1411243235-24680-2-git-send-email-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1411243235-24680-2-git-send-email-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: linux-mm@kvack.org, Michal Hocko , Greg Thelen , Tejun Heo , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org On Sat, Sep 20, 2014 at 04:00:33PM -0400, Johannes Weiner wrote: > Charges currently pin the css indirectly by playing tricks during > css_offline(): user pages stall the offlining process until all of > them have been reparented, whereas kmemcg acquires a keep-alive > reference if outstanding kernel pages are detected at that point. > > In preparation for removing all this complexity, make the pinning > explicit and acquire a css references for every charged page. > > Signed-off-by: Johannes Weiner Reviewed-by: Vladimir Davydov Nit: In __mem_cgroup_clear_mc, we have the following hunk: > for (i = 0; i < mc.moved_swap; i++) > css_put(&mc.from->css); Now we can simplify it using css_put_many. Thanks, Vladimir -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org