From: Nick Piggin <nickpiggin@yahoo.com.au>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: balbir@linux.vnet.ibm.com,
Andrew Morton <akpm@linux-foundation.org>,
hugh@veritas.com, menage@google.com, xemul@openvz.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC][PATCH] Remove cgroup member from struct page
Date: Tue, 9 Sep 2008 15:00:10 +1000 [thread overview]
Message-ID: <200809091500.10619.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20080909135317.cbff4871.kamezawa.hiroyu@jp.fujitsu.com>
On Tuesday 09 September 2008 14:53, KAMEZAWA Hiroyuki wrote:
> On Tue, 9 Sep 2008 13:58:27 +1000
>
> Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> > On Tuesday 09 September 2008 13:57, KAMEZAWA Hiroyuki wrote:
> > > On Mon, 8 Sep 2008 20:58:10 +0530
> > >
> > > Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> > > > Sorry for the delay in sending out the new patch, I am traveling and
> > > > thus a little less responsive. Here is the update patch
> > >
> > > Hmm.. I've considered this approach for a while and my answer is that
> > > this is not what you really want.
> > >
> > > Because you just moves the placement of pointer from memmap to
> > > radix_tree both in GFP_KERNEL, total kernel memory usage is not
> > > changed. So, at least, you have to add some address calculation (as I
> > > did in March) to getting address of page_cgroup. But page_cgroup itself
> > > consumes 32bytes per page. Then.....
> >
> > Just keep in mind that an important point is to make it more attractive
> > to configure cgroup into the kernel, but have it disabled or unused at
> > runtime.
>
> Hmm..kicking out 4bytes per 4096bytes if disabled ?
Yeah of course. 4 or 8 bytes. Everything adds up. There is nothing special
about cgroups that says it is allowed to use fields in struct page where
others cannot. Put it in perspective: we try very hard not to allocate new
*bits* in page flags, which is only 4 bytes per 131072 bytes.
> maybe a routine like SPARSEMEM is a choice.
>
> Following is pointer pre-allocation. (just pointer, not page_cgroup itself)
> ==
> #define PCG_SECTION_SHIFT (10)
> #define PCG_SECTION_SIZE (1 << PCG_SECTION_SHIFT)
>
> struct pcg_section {
> struct page_cgroup **map[PCG_SECTION_SHIFT]; //array of pointer.
> };
>
> struct page_cgroup *get_page_cgroup(unsigned long pfn)
> {
> struct pcg_section *sec;
> sec = pcg_section[(pfn >> PCG_SECTION_SHIFT)];
> return *sec->page_cgroup[(pfn & ((1 << PCG_SECTTION_SHIFT) - 1];
> }
> ==
> If we go extreme, we can use kmap_atomic() for pointer array.
>
> Overhead of pointer-walk is not so bad, maybe.
>
> For 64bit systems, we can find a way like SPARSEMEM_VMEMMAP.
Yes I too think that would be the ideal way to go to get the best of
performance in the enabled case. However Balbir I believe is interested
in memory savings if not all pages have cgroups... I don't know, I don't
care so much about the "enabled" case, so I'll leave you two to fight it
out :)
--
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>
next prev parent reply other threads:[~2008-09-09 5:00 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-31 17:47 Balbir Singh
2008-09-01 0:01 ` KAMEZAWA Hiroyuki
2008-09-01 3:28 ` Balbir Singh
2008-09-01 4:03 ` KAMEZAWA Hiroyuki
2008-09-01 5:17 ` KAMEZAWA Hiroyuki
2008-09-01 6:16 ` Balbir Singh
2008-09-01 6:09 ` Balbir Singh
2008-09-01 6:24 ` KAMEZAWA Hiroyuki
2008-09-01 6:25 ` Balbir Singh
2008-09-01 6:59 ` KAMEZAWA Hiroyuki
2008-09-01 6:56 ` Nick Piggin
2008-09-01 7:17 ` Balbir Singh
2008-09-01 7:19 ` KAMEZAWA Hiroyuki
2008-09-01 7:43 ` Nick Piggin
2008-09-02 9:24 ` Balbir Singh
2008-09-02 10:02 ` KAMEZAWA Hiroyuki
2008-09-02 9:58 ` Balbir Singh
2008-09-02 10:07 ` KAMEZAWA Hiroyuki
2008-09-02 10:12 ` Balbir Singh
2008-09-02 10:57 ` KAMEZAWA Hiroyuki
2008-09-02 12:37 ` Balbir Singh
2008-09-03 3:33 ` KAMEZAWA Hiroyuki
2008-09-03 7:31 ` Balbir Singh
2008-09-08 15:28 ` Balbir Singh
2008-09-09 3:57 ` KAMEZAWA Hiroyuki
2008-09-09 3:58 ` Nick Piggin
2008-09-09 4:53 ` KAMEZAWA Hiroyuki
2008-09-09 5:00 ` Nick Piggin [this message]
2008-09-09 5:12 ` KAMEZAWA Hiroyuki
2008-09-09 12:24 ` Balbir Singh
2008-09-09 12:28 ` Nick Piggin
2008-09-09 12:30 ` kamezawa.hiroyu
2008-09-09 12:34 ` Balbir Singh
2008-09-10 1:20 ` [Approach #2] " Balbir Singh
2008-09-10 1:49 ` KAMEZAWA Hiroyuki
2008-09-10 2:11 ` Balbir Singh
2008-09-10 2:35 ` KAMEZAWA Hiroyuki
2008-09-10 20:44 ` Nick Piggin
2008-09-10 11:03 ` KAMEZAWA Hiroyuki
2008-09-10 21:02 ` Nick Piggin
2008-09-10 11:27 ` KAMEZAWA Hiroyuki
2008-09-10 14:34 ` Balbir Singh
2008-09-10 22:21 ` Dave Hansen
2008-09-10 22:31 ` David Miller, Dave Hansen
2008-09-10 22:36 ` Balbir Singh
2008-09-10 22:56 ` Dave Hansen
2008-09-11 1:35 ` KAMEZAWA Hiroyuki
2008-09-11 1:47 ` Balbir Singh
2008-09-11 1:56 ` KAMEZAWA Hiroyuki
2008-09-17 23:28 ` [RFC][PATCH] Remove cgroup member from struct page (v3) Balbir Singh
2008-09-18 1:40 ` Andrew Morton
2008-09-18 3:57 ` Balbir Singh
2008-09-18 5:00 ` KAMEZAWA Hiroyuki
2008-09-18 4:26 ` Hirokazu Takahashi
2008-09-18 4:50 ` KAMEZAWA Hiroyuki
2008-09-18 6:13 ` Hirokazu Takahashi
2008-09-18 4:43 ` KAMEZAWA Hiroyuki
2008-09-18 4:58 ` Balbir Singh
2008-09-18 5:15 ` KAMEZAWA Hiroyuki
2008-09-18 11:01 ` KAMEZAWA Hiroyuki
2008-09-18 23:56 ` Balbir Singh
2008-09-19 0:37 ` KAMEZAWA Hiroyuki
2008-09-10 22:38 ` [Approach #2] [RFC][PATCH] Remove cgroup member from struct page Nick Piggin
2008-09-09 4:18 ` Balbir Singh
2008-09-09 4:55 ` KAMEZAWA Hiroyuki
2008-09-09 7:37 ` KAMEZAWA Hiroyuki
2008-09-01 2:39 ` KAMEZAWA Hiroyuki
2008-09-01 3:42 ` Balbir Singh
2008-09-01 9:03 ` Pavel Emelyanov
2008-09-01 9:17 ` Balbir Singh
2008-09-01 9:43 ` Pavel Emelyanov
2008-09-01 13:19 ` Peter Zijlstra
2008-09-02 7:35 ` 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=200809091500.10619.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=hugh@veritas.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=xemul@openvz.org \
/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