linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shi Weihua <shiwh@cn.fujitsu.com>
To: balbir@linux.vnet.ibm.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>,
	xemul@openvz.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, hugh@veritas.com
Subject: Re: [PATCH] memcgroup: check and initialize page->cgroup in memmap_init_zone
Date: Fri, 18 Apr 2008 11:49:38 +0800	[thread overview]
Message-ID: <48081A52.8040802@cn.fujitsu.com> (raw)
In-Reply-To: <4808177F.3090208@linux.vnet.ibm.com>

Balbir Singh wrote::
> Andrew Morton wrote:
>> On Fri, 18 Apr 2008 10:46:30 +0800 Shi Weihua <shiwh@cn.fujitsu.com> wrote:
>>
>>> When we test memory controller in Fujitsu PrimeQuest(arch: ia64),
>>> the compiled kernel boots failed, the following message occured on
>>> the telnet terminal.
>>> -------------------------------------
>>> ..........
>>> ELILO boot: Uncompressing Linux... done
>>> Loading file initrd-2.6.25-rc9-00067-gb87e81e.img...done
>>> _ (system freezed)
>>> -------------------------------------
>>>
>>> We found commit 9442ec9df40d952b0de185ae5638a74970388e01
>>> causes this boot failure by git-bisect.
>>> And, we found the following change caused the boot failure.
>>> -------------------------------------
>>> @@ -2528,7 +2535,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zon
>>>                 set_page_links(page, zone, nid, pfn);
>>>                 init_page_count(page);
>>>                 reset_page_mapcount(page);
>>> -               page_assign_page_cgroup(page, NULL);
>>>                 SetPageReserved(page);
>>>
>>>                 /*
>>> -------------------------------------
>>> 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.
>>>
> 
> The comment from Hugh is correct, which implies that in this case page->cgroup
> is not zeroed.
> 
>>> Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com> 
>>> ---
>>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>>> index 402a504..506d4cf 100644
>>> --- a/mm/page_alloc.c
>>> +++ b/mm/page_alloc.c
>>> @@ -2518,6 +2518,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
>>>  	struct page *page;
>>>  	unsigned long end_pfn = start_pfn + size;
>>>  	unsigned long pfn;
>>> +	void *pc;
>>>  
>>>  	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);
>>>  
>> hm, fishy.  Perhaps the architecture isn't zeroing the memmap arrays?
>>
> 
> The mem_map array should be cleared. I need to see the code to check where the
> clearing takes place.
> 
>> Or perhaps that page was used and then later freed before we got to
>> memmap_init_zone() and was freed with a non-zero ->page_cgroup.  Which is
>> unlikely given that page.page_cgroup was only just added and is only
>> present if CONFIG_CGROUP_MEM_RES_CTLR.
> 
> Please share your .config? Is this a kexec/kdump reboot by any chance?
> 

.config is shared in previous mails.
kexec/kdump has not been used.

Thanks
-Shi

--
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>

  reply	other threads:[~2008-04-18  3:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48080706.50305@cn.fujitsu.com>
     [not found] ` <48080930.5090905@cn.fujitsu.com>
2008-04-18  2:46   ` [PATCH] memcgroup: check and initialize page->cgroup in memmap_init_zone Shi Weihua
2008-04-18  3:04     ` KAMEZAWA Hiroyuki
2008-04-18  3:14       ` Shi Weihua
2008-04-18  3:14     ` Andrew Morton
2008-04-18  3:32       ` KAMEZAWA Hiroyuki
2008-04-18  5:09         ` KAMEZAWA Hiroyuki
2008-04-18  5:43           ` Shi Weihua
2008-04-18  5:57             ` KAMEZAWA Hiroyuki
2008-04-18  6:47             ` KAMEZAWA Hiroyuki
2008-04-18  3:37       ` Balbir Singh
2008-04-18  3:49         ` Shi Weihua [this message]
2008-04-18 12:12     ` [PATCH]Fix usemap for DISCONTIG/FLATMEM with not-aligned zone initilaization KAMEZAWA Hiroyuki
2008-04-18 16:15       ` Mel Gorman
2008-04-18 17:41         ` Dave Hansen
2008-04-18 17:25       ` kamezawa.hiroyu
2008-04-21  2:20         ` KAMEZAWA Hiroyuki
2008-04-21 10:12           ` Mel Gorman
2008-04-21 10:29             ` KAMEZAWA Hiroyuki
2008-04-21 11:56           ` Hugh Dickins
2008-04-22  1:40             ` [BUGFIX][PATCH] Fix usemap initialization v2 KAMEZAWA Hiroyuki
2008-04-22 10:12               ` Hugh Dickins
2008-04-23  1:45                 ` KAMEZAWA Hiroyuki
2008-04-23  2:17                 ` Shi Weihua
2008-04-23  4:46               ` [BUGFIX][PATCH] Fix usemap initialization v3 KAMEZAWA Hiroyuki
2008-04-23  6:19                 ` Shi Weihua
2008-04-23  8:04                   ` KAMEZAWA Hiroyuki
2008-04-23 12:46                 ` Mel Gorman
2008-04-27 19:18                 ` Andrew Morton
2008-04-27 19:30                   ` Balbir Singh
2008-04-27 22:50                     ` Hugh Dickins
2008-04-28  0:39                   ` KAMEZAWA Hiroyuki
2008-04-21 13:02           ` Re: [PATCH]Fix usemap for DISCONTIG/FLATMEM with not-aligned zone initilaization kamezawa.hiroyu

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=48081A52.8040802@cn.fujitsu.com \
    --to=shiwh@cn.fujitsu.com \
    --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=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;
as well as URLs for NNTP newsgroup(s).