Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177611
b: refs/heads/master
c: 588f9ce
h: refs/heads/master
i:
  177609: 7f557bd
  177607: 756bcef
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Dec 16, 2009
1 parent 1509f75 commit d039674
Show file tree
Hide file tree
Showing 3 changed files with 24 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: 7bc98b97ed5dfe710025414de771baa674998892
refs/heads/master: 588f9ce6ca61ecb4663ee6ef2f75d2d96c73151e
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@ extern void memory_failure(unsigned long pfn, int trapno);
extern int __memory_failure(unsigned long pfn, int trapno, int ref);
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p);
extern atomic_long_t mce_bad_pages;

#endif /* __KERNEL__ */
Expand Down
22 changes: 22 additions & 0 deletions trunk/mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,28 @@ static int kill_proc_ao(struct task_struct *t, unsigned long addr, int trapno,
return ret;
}

/*
* When a unknown page type is encountered drain as many buffers as possible
* in the hope to turn the page into a LRU or free page, which we can handle.
*/
void shake_page(struct page *p)
{
if (!PageSlab(p)) {
lru_add_drain_all();
if (PageLRU(p))
return;
drain_all_pages();
if (PageLRU(p) || is_free_buddy_page(p))
return;
}
/*
* Could call shrink_slab here (which would also
* shrink other caches). Unfortunately that might
* also access the corrupted page, which could be fatal.
*/
}
EXPORT_SYMBOL_GPL(shake_page);

/*
* Kill all processes that have a poisoned page mapped and then isolate
* the page.
Expand Down

0 comments on commit d039674

Please sign in to comment.