lkml.org 
[lkml]   [2008]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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




\
 
 \ /
  Last update: 2008-04-18 05:15    [W:0.878 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site