Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338730
b: refs/heads/master
c: 95a4774
h: refs/heads/master
v: v3
  • Loading branch information
Wen Congyang authored and Linus Torvalds committed Dec 12, 2012
1 parent 542f316 commit 0882790
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b023f46813cde6e3b8a8c24f432ff9c1fd8e9a64
refs/heads/master: 95a4774d055c72d96ab192a1c6675cbf4d513f71
22 changes: 22 additions & 0 deletions trunk/mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,27 @@ int __meminit sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
return ret;
}

#ifdef CONFIG_MEMORY_FAILURE
static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
{
int i;

if (!memmap)
return;

for (i = 0; i < PAGES_PER_SECTION; i++) {
if (PageHWPoison(&memmap[i])) {
atomic_long_sub(1, &mce_bad_pages);
ClearPageHWPoison(&memmap[i]);
}
}
}
#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)
{
struct page *memmap = NULL;
Expand All @@ -784,6 +805,7 @@ void sparse_remove_one_section(struct zone *zone, struct mem_section *ms)
ms->pageblock_flags = NULL;
}

clear_hwpoisoned_pages(memmap, PAGES_PER_SECTION);
free_section_usemap(memmap, usemap);
}
#endif

0 comments on commit 0882790

Please sign in to comment.