lkml.org 
[lkml]   [2012]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 2/5] memory-hotplug: update mce_bad_pages when removing the memory
On Wed, 17 Oct 2012 08:09:55 -0700
Dave Hansen <dave@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 the same thing.

What does this observation mean?

> > + for (i = 0; i < PAGES_PER_SECTION; i++) {
> > + if (PageHWPoison(&memmap[i])) {
> > + atomic_long_sub(1, &mce_bad_pages);
> > + ClearPageHWPoison(&memmap[i]);
> > + }
> > + }
> > +}
> > +#endif
> > +
> > void sparse_remove_one_section(struct zone *zone, struct mem_section *ms)
> > {
> > struct page *memmap = NULL;
>
> ..
>
> and keep the #ifdef out of sparse_remove_one_section().

yup.

--- a/mm/sparse.c~memory-hotplug-update-mce_bad_pages-when-removing-the-memory-fix
+++ a/mm/sparse.c
@@ -788,6 +788,10 @@ static void clear_hwpoisoned_pages(struc
}
}
}
+#else
+static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
+{
+}
#endif

void sparse_remove_one_section(struct zone *zone, struct mem_section *ms)
@@ -803,10 +807,7 @@ void sparse_remove_one_section(struct zo
ms->pageblock_flags = NULL;
}

-#ifdef CONFIG_MEMORY_FAILURE
clear_hwpoisoned_pages(memmap, PAGES_PER_SECTION);
-#endif
-
free_section_usemap(memmap, usemap);
}
#endif
_


\
 
 \ /
  Last update: 2012-10-19 01:01    [W:0.110 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site