aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index e5ee0ca7ae85..feb803bf3443 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -239,19 +239,14 @@ void shake_page(struct page *p, int access)
239 } 239 }
240 240
241 /* 241 /*
242 * Only call shrink_slab here (which would also shrink other caches) if 242 * Only call shrink_node_slabs here (which would also shrink
243 * access is not potentially fatal. 243 * other caches) if access is not potentially fatal.
244 */ 244 */
245 if (access) { 245 if (access) {
246 int nr; 246 int nr;
247 int nid = page_to_nid(p); 247 int nid = page_to_nid(p);
248 do { 248 do {
249 struct shrink_control shrink = { 249 nr = shrink_node_slabs(GFP_KERNEL, nid, 1000, 1000);
250 .gfp_mask = GFP_KERNEL,
251 };
252 node_set(nid, shrink.nodes_to_scan);
253
254 nr = shrink_slab(&shrink, 1000, 1000);
255 if (page_count(p) == 1) 250 if (page_count(p) == 1)
256 break; 251 break;
257 } while (nr > 10); 252 } while (nr > 10);
@@ -466,7 +461,7 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
466 struct task_struct *tsk; 461 struct task_struct *tsk;
467 struct address_space *mapping = page->mapping; 462 struct address_space *mapping = page->mapping;
468 463
469 mutex_lock(&mapping->i_mmap_mutex); 464 i_mmap_lock_read(mapping);
470 read_lock(&tasklist_lock); 465 read_lock(&tasklist_lock);
471 for_each_process(tsk) { 466 for_each_process(tsk) {
472 pgoff_t pgoff = page_to_pgoff(page); 467 pgoff_t pgoff = page_to_pgoff(page);
@@ -488,7 +483,7 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
488 } 483 }
489 } 484 }
490 read_unlock(&tasklist_lock); 485 read_unlock(&tasklist_lock);
491 mutex_unlock(&mapping->i_mmap_mutex); 486 i_mmap_unlock_read(mapping);
492} 487}
493 488
494/* 489/*