From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbbC0VmA (ORCPT ); Fri, 27 Mar 2015 17:42:00 -0400 Received: from mail-qc0-f181.google.com ([209.85.216.181]:33263 "EHLO mail-qc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752387AbbC0Vl6 (ORCPT ); Fri, 27 Mar 2015 17:41:58 -0400 Date: Fri, 27 Mar 2015 17:41:54 -0400 From: Tejun Heo To: Vivek Goyal Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, jack@suse.cz, hch@infradead.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, 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 Subject: Re: [PATCH 21/48] writeback: make backing_dev_info host cgroup-specific bdi_writebacks Message-ID: <20150327214154.GE638@htj.duckdns.org> References: <1427086499-15657-1-git-send-email-tj@kernel.org> <1427086499-15657-22-git-send-email-tj@kernel.org> <20150327210612.GA23840@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150327210612.GA23840@redhat.com> 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 Hello Vivek. On Fri, Mar 27, 2015 at 05:06:13PM -0400, Vivek Goyal wrote: > I was curious to know that why do we need this "struct page *page" when > trying to attach a inode to a bdi_writeback. Is using current's cgroup > always not sufficient? So, memcg's page ownership is first-use based and it never gets updated once set till the page is released which means that there can be corner cases where an inode is mostly faulted in by one cgroup and then constantly dirtied by another. Because the ownership belongs to the initial cgroup which instantiated those pages, cgroup writeback ends up considering the pages as belonging to that initial cgroup and the foreign detection will trigger if it's being written by a different cgroup. Hmmmm... this isn't a huge problem as once the foreign detection triggers, the problem will be corrected but still when the page is availalbe, I think it makes sense to attach to the page as that's what actually defines the ownership. Thanks. -- tejun