Messages in this thread | | | Date | Fri, 18 Apr 2008 12:04:56 +0900 | From | KAMEZAWA Hiroyuki <> | Subject | Re: [PATCH] memcgroup: check and initialize page->cgroup in memmap_init_zone |
| |
On Fri, 18 Apr 2008 10:46:30 +0800 Shi Weihua <shiwh@cn.fujitsu.com> wrote:
> In this patch, the Author Hugh Dickins said > "...memmap_init_zone doesn't need it either, ... > Linux assumes pointers in zeroed structures are NULL pointers." > But it seems it's not always the case, so we should check and initialize > page->cgroup anyways. > Hmm...strange. (I never see this with 2.6.25 + Primequest) What memory model are you using ? CONFIG_SPRASEMEM_VMEMMAP ?
> for (pfn = start_pfn; pfn < end_pfn; pfn++) { > /* > @@ -2535,6 +2536,9 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, > set_page_links(page, zone, nid, pfn); > init_page_count(page); > reset_page_mapcount(page); > + pc = page_get_page_cgroup(page); > + if (pc) > + page_reset_bad_cgroup(page); > SetPageReserved(page); > BTW, page_reset_page_cgroup, defined as this == #define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0) == Should be == #define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0UL) == ...I'll write a patch.
Thanks, -Kame
| |