Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-19 Thread Dave Hansen
On 10/18/2012 03:20 PM, Andrew Morton wrote: > On Wed, 17 Oct 2012 08:09:55 -0700 > Dave Hansen wrote: >>> +#ifdef CONFIG_MEMORY_FAILURE >>> +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) >>> +{ >>> + int i; >>> + >>> + if (!memmap) >>> + return; >> >> I

Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-19 Thread Dave Hansen
On 10/18/2012 03:20 PM, Andrew Morton wrote: On Wed, 17 Oct 2012 08:09:55 -0700 Dave Hansen d...@linux.vnet.ibm.com wrote: +#ifdef CONFIG_MEMORY_FAILURE +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) +{ + int i; + + if (!memmap) + return; I guess

Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-18 Thread Andrew Morton
On Wed, 17 Oct 2012 08:09:55 -0700 Dave Hansen wrote: > Hi Wen, > > > +#ifdef CONFIG_MEMORY_FAILURE > > +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) > > +{ > > + int i; > > + > > + if (!memmap) > > + return; > > I guess free_section_usemap() does the

Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-18 Thread Andrew Morton
On Wed, 17 Oct 2012 08:09:55 -0700 Dave Hansen d...@linux.vnet.ibm.com wrote: Hi Wen, +#ifdef CONFIG_MEMORY_FAILURE +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) +{ + int i; + + if (!memmap) + return; I guess free_section_usemap() does

Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-17 Thread Dave Hansen
Hi Wen, > +#ifdef CONFIG_MEMORY_FAILURE > +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) > +{ > + int i; > + > + if (!memmap) > + return; I guess free_section_usemap() does the same thing. > + for (i = 0; i < PAGES_PER_SECTION; i++) { > +

[PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-17 Thread wency
From: Wen Congyang When we hotremove a memory device, we will free the memory to store struct page. If the page is hwpoisoned page, we should decrease mce_bad_pages. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc:

[PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-17 Thread wency
From: Wen Congyang we...@cn.fujitsu.com When we hotremove a memory device, we will free the memory to store struct page. If the page is hwpoisoned page, we should decrease mce_bad_pages. CC: David Rientjes rient...@google.com CC: Jiang Liu liu...@gmail.com CC: Len Brown len.br...@intel.com CC:

Re: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory

2012-10-17 Thread Dave Hansen
Hi Wen, +#ifdef CONFIG_MEMORY_FAILURE +static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) +{ + int i; + + if (!memmap) + return; I guess free_section_usemap() does the same thing. + for (i = 0; i PAGES_PER_SECTION; i++) { + if