From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vivek Goyal Subject: [RFC] Storing cgroup id in page->private (Was: Re: [RFC] [PATCH 0/6] Provide cgroup isolation for buffered writes.) Date: Thu, 10 Mar 2011 14:11:15 -0500 Message-ID: <20110310191115.GG29464@redhat.com> References: <1299619256-12661-1-git-send-email-teravest@google.com> <20110309142237.6ab82523.kamezawa.hiroyu@jp.fujitsu.com> <20110310181529.GF29464@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: KAMEZAWA Hiroyuki , m-ikeda@ds.jp.nec.com, jaxboe@fusionio.com, linux-kernel@vger.kernel.org, ryov@valinux.co.jp, taka@valinux.co.jp, righi.andrea@gmail.com, guijianfeng@cn.fujitsu.com, balbir@linux.vnet.ibm.com, ctalbott@google.com, nauman@google.com, mrubin@google.com, linux-fsdevel@vger.kernel.org, Chris Mason To: Justin TerAvest Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Mar 10, 2011 at 10:57:52AM -0800, Justin TerAvest wrote: > On Thu, Mar 10, 2011 at 10:15 AM, Vivek Goyal wro= te: > > On Thu, Mar 10, 2011 at 10:08:03AM -0800, Justin TerAvest wrote: > > > > [..] > >> > I don't like to increase size of page_cgroup but I think you can= record > >> > information without increasing size of page_cgroup. > >> > > >> > A) As Andrea did, encode it to pc->flags. > >> > =A0 But I'm afraid that there is a racy case because memory cgro= up uses some > >> > =A0 test_and_set() bits. > >> > B) I wonder why the information cannot be recorded in page->priv= ate. > >> > =A0 When page has buffers, you can record the information to buf= fer struct. > >> > =A0 About swapio (if you take care of), you can record informati= on to bio. > >> > >> Hi Kame, > >> > >> I'm concerned that by using something like buffer_heads stored in > >> page->private, we will only be supported on some filesystems and n= ot > >> others. In addition, I'm not sure if all filesystems attach buffer > >> heads at the same time; if page->private is modified in the flushe= r > >> thread, we might not be able to determine the thread that dirtied = the > >> page in the first place. > > > > I think the person who dirtied the page can store the information i= n > > page->private (assuming buffer heads were not generated) and if flu= sher > > thread later ends up generating buffer heads and ends up modifying > > page->private, this can be copied in buffer heads? >=20 > This scares me a bit. >=20 > As I understand it, fs/ code expects total ownership of page->private= =2E > This adds a responsibility for every user to copy the data through an= d > store it in the buffer head (or anything else). btrfs seems to do > something entirely different in some cases and store a different kind > of value. If filesystems are using page->private for some other purpose also, the= n I guess we have issues.=20 I am ccing linux-fsdevel to have some feedback on the idea of trying to store cgroup id of page dirtying thread in page->private and/or buff= er head for tracking which group originally dirtied the page in IO control= ler during writeback. >=20 > I don't know that it's right to add the burden to copy the original > value to everything that wants to use page->private. >=20 How many such places are there? Thanks Vivek