On Tue, 9 Sep 2008 13:58:27 +1000
Nick Piggin wrote:> On Tuesday 09 September 2008 13:57, KAMEZAWA Hiroyuki wrote:
Hmm..kicking out 4bytes per 4096bytes if disabled ?
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.
Thanks,
-Kame
Thanks,
-Kame
--
| Al Boldi | Re: [ck] Re: [ANNOUNCE] RSDL completely fair starvation free interactive cpu sched... |
| Ingo Molnar | Re: [patch] sched_clock(): cleanups |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| Denys Vlasenko | [PATCH 1/2] bnx2: factor out gzip unpacker |
