Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbbEXVYs (ORCPT ); Sun, 24 May 2015 17:24:48 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:33307 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbbEXVYo (ORCPT ); Sun, 24 May 2015 17:24:44 -0400 Date: Sun, 24 May 2015 17:24:40 -0400 From: Tejun Heo To: Johannes Weiner Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, jack@suse.cz, hch@infradead.org, linux-fsdevel@vger.kernel.org, vgoyal@redhat.com, lizefan@huawei.com, cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz, clm@fb.com, fengguang.wu@intel.com, david@fromorbit.com, gthelen@google.com, khlebnikov@yandex-team.ru Subject: Re: [PATCH 11/51] memcg: implement mem_cgroup_css_from_page() Message-ID: <20150524212440.GD7099@htj.duckdns.org> References: <1432329245-5844-1-git-send-email-tj@kernel.org> <1432329245-5844-12-git-send-email-tj@kernel.org> <20150522232831.GB6485@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150522232831.GB6485@cmpxchg.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 27 Hello, On Fri, May 22, 2015 at 07:28:31PM -0400, Johannes Weiner wrote: > replace_page_cache() can clear page->mem_cgroup even when the page > still has references, so unfortunately you must hold the page lock > when calling this function. > > I haven't checked how you use this - chances are you always have the > page locked anyways - but it probably needs a comment. Hmmm... as replace_page_cache_page() is used only by fuse and fuse's bdi doesn't go through the usual writeback accounting which is necessary for cgroup writeback support anyway, so I don't think this presents an actual problem. I'll add a warning in replace_page_cache_page() which triggers when it's used on a bdi which has cgroup writeback enabled and add comments explaining what's going on. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/