linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Munehiro Ikeda <m-ikeda@ds.jp.nec.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	gthelen@google.com,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH 4/7][memcg] memcg use ID in page_cgroup
Date: Wed, 28 Jul 2010 11:43:33 -0400	[thread overview]
Message-ID: <4C505025.1040709@ds.jp.nec.com> (raw)
In-Reply-To: <20100728031358.GG12642@redhat.com>

Vivek Goyal wrote, on 07/27/2010 11:13 PM:
> On Wed, Jul 28, 2010 at 11:44:02AM +0900, KAMEZAWA Hiroyuki wrote:
>> On Tue, 27 Jul 2010 22:39:04 -0400
>> Vivek Goyal<vgoyal@redhat.com>  wrote:
>>
>>> On Tue, Jul 27, 2010 at 04:56:29PM +0900, KAMEZAWA Hiroyuki wrote:
>>>> From: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
>>>>
>>>> Now, addresses of memory cgroup can be calculated by their ID without complex.
>>>> This patch relplaces pc->mem_cgroup from a pointer to a unsigned short.
>>>> On 64bit architecture, this offers us more 6bytes room per page_cgroup.
>>>> Use 2bytes for blkio-cgroup's page tracking. More 4bytes will be used for
>>>> some light-weight concurrent access.
>>>>
>>>> We may able to move this id onto flags field but ...go step by step.
>>>>
>>>> Signed-off-by: KAMEZAWA Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com>
>>>> ---
>>>>   include/linux/page_cgroup.h |    3 ++-
>>>>   mm/memcontrol.c             |   40 +++++++++++++++++++++++++---------------
>>>>   mm/page_cgroup.c            |    2 +-
>>>>   3 files changed, 28 insertions(+), 17 deletions(-)
>>>>
>>>> Index: mmotm-0719/include/linux/page_cgroup.h
>>>> ===================================================================
>>>> --- mmotm-0719.orig/include/linux/page_cgroup.h
>>>> +++ mmotm-0719/include/linux/page_cgroup.h
>>>> @@ -12,7 +12,8 @@
>>>>    */
>>>>   struct page_cgroup {
>>>>   	unsigned long flags;
>>>> -	struct mem_cgroup *mem_cgroup;
>>>> +	unsigned short mem_cgroup;	/* ID of assigned memory cgroup */
>>>> +	unsigned short blk_cgroup;	/* Not Used..but will be. */
>>>
>>> So later I shall have to use virtually indexed arrays in blkio controller?
>>> Or you are just using virtually indexed arrays for lookup speed and
>>> I can continue to use css_lookup() and not worry about using virtually
>>> indexed arrays.
>>>
>> yes. you can use css_lookup() even if it's slow.
>>
>
> Ok.
>
>>> So the idea is that when a page is allocated, also store the blk_group
>>> id and once that page is submitted for writeback, we should be able
>>> to associate it to right blkio group?
>>>
>> blk_cgroup id can be attached whenever you wants. please overwrite
>> page_cgroup->blk_cgroup when it's necessary.
>
>> Did you read Ikeda's patch ? I myself doesn't have patches at this point.
>> This is just for make a room for recording blkio-ID, which was requested
>> for a year.
>
> I have not read his patches yet. IIRC, previously there were issues
> regarding which group should be charged for the page. The person who
> allocated it or the thread which did last write to it etc... I guess
> we can sort that out later.

Absolutely.
iotrack, a part of blkio cgroup for async write patch I posted, charges
the thread (in exact, blkio-cgroup to which the thread belongs) which
dirtied the page first.  Though it should be controversial and we need
to discuss who should be charged, adding pc->blk_cgroup has no problem
because blkio-cgroup can overwrite it any time, as Kame said above.

Beyond that, adding pc->blk_cgroup is a big step for us.  Now I encode
and store ID in pc->flags.  pc->blk_cgroup is more straight and that
is what we have been looking forward.  Thanks Kame!



-- 
IKEDA, Munehiro
   NEC Corporation of America
     m-ikeda@ds.jp.nec.com

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2010-07-28 15:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27  7:51 [RFC][PATCH 0/7][memcg] towards I/O aware memory cgroup KAMEZAWA Hiroyuki
2010-07-27  7:53 ` [RFC][PATCH 1/7][memcg] virtually indexed array library KAMEZAWA Hiroyuki
2010-07-27 18:29   ` Jonathan Corbet
2010-07-28  0:08     ` KAMEZAWA Hiroyuki
2010-07-28 19:45   ` Andrew Morton
2010-07-29  0:32     ` KAMEZAWA Hiroyuki
2010-07-29  4:27       ` KAMEZAWA Hiroyuki
2010-08-02 18:00         ` Balbir Singh
2010-08-02 23:45           ` KAMEZAWA Hiroyuki
2010-07-27  7:54 ` [RFC][PATCH 2/7][memcg] cgroup arbitarary ID allocation KAMEZAWA Hiroyuki
2010-07-28  2:30   ` Vivek Goyal
2010-07-28  2:35     ` KAMEZAWA Hiroyuki
2010-07-28  3:10       ` Vivek Goyal
2010-08-02 18:04   ` Balbir Singh
2010-08-02 23:45     ` KAMEZAWA Hiroyuki
2010-07-27  7:55 ` [RFC][PATCH 3/7][memcg] memcg on virt array for quick access via ID KAMEZAWA Hiroyuki
2010-07-27  7:56 ` [RFC][PATCH 4/7][memcg] memcg use ID in page_cgroup KAMEZAWA Hiroyuki
2010-07-28  2:39   ` Vivek Goyal
2010-07-28  2:44     ` KAMEZAWA Hiroyuki
2010-07-28  3:13       ` Vivek Goyal
2010-07-28  3:18         ` KAMEZAWA Hiroyuki
2010-07-28  3:21           ` KAMEZAWA Hiroyuki
2010-07-28 14:17             ` Vivek Goyal
2010-07-28 15:43         ` Munehiro Ikeda [this message]
2010-07-27  7:59 ` [RFC][PATCH 5/7][memcg] memcg lockless update of file mapped KAMEZAWA Hiroyuki
2010-07-28  7:09   ` Greg Thelen
2010-07-28  7:13     ` KAMEZAWA Hiroyuki
2010-07-27  8:00 ` [RFC][PATCH 6/7][memcg] generic file status update KAMEZAWA Hiroyuki
2010-07-28  7:12   ` Greg Thelen
2010-07-28  7:14     ` KAMEZAWA Hiroyuki
2010-07-27  8:02 ` [RFC][PATCH 7/7][memcg] use spin lock instead of bit_spin_lock in page_cgroup KAMEZAWA Hiroyuki
2010-07-28  6:16   ` Greg Thelen
2010-07-28  6:20     ` KAMEZAWA Hiroyuki
2010-08-02 18:09     ` Balbir Singh
2010-08-02 23:46       ` KAMEZAWA Hiroyuki
2010-07-28  0:13 ` [RFC][PATCH 0/7][memcg] towards I/O aware memory cgroup KAMEZAWA Hiroyuki
2010-07-28 14:42 ` Balbir Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C505025.1040709@ds.jp.nec.com \
    --to=m-ikeda@ds.jp.nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=gthelen@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox