macvtap: fix uninitialized access on TUNSETIFF
[cascardo/linux.git] / mm / memory-failure.c
index 8639f6b..feb803b 100644 (file)
@@ -233,25 +233,20 @@ void shake_page(struct page *p, int access)
                lru_add_drain_all();
                if (PageLRU(p))
                        return;
-               drain_all_pages();
+               drain_all_pages(page_zone(p));
                if (PageLRU(p) || is_free_buddy_page(p))
                        return;
        }
 
        /*
-        * Only call shrink_slab here (which would also shrink other caches) if
-        * access is not potentially fatal.
+        * Only call shrink_node_slabs here (which would also shrink
+        * other caches) if access is not potentially fatal.
         */
        if (access) {
                int nr;
                int nid = page_to_nid(p);
                do {
-                       struct shrink_control shrink = {
-                               .gfp_mask = GFP_KERNEL,
-                       };
-                       node_set(nid, shrink.nodes_to_scan);
-
-                       nr = shrink_slab(&shrink, 1000, 1000);
+                       nr = shrink_node_slabs(GFP_KERNEL, nid, 1000, 1000);
                        if (page_count(p) == 1)
                                break;
                } while (nr > 10);
@@ -466,7 +461,7 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
        struct task_struct *tsk;
        struct address_space *mapping = page->mapping;
 
-       mutex_lock(&mapping->i_mmap_mutex);
+       i_mmap_lock_read(mapping);
        read_lock(&tasklist_lock);
        for_each_process(tsk) {
                pgoff_t pgoff = page_to_pgoff(page);
@@ -488,7 +483,7 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
                }
        }
        read_unlock(&tasklist_lock);
-       mutex_unlock(&mapping->i_mmap_mutex);
+       i_mmap_unlock_read(mapping);
 }
 
 /*
@@ -860,7 +855,6 @@ static int page_action(struct page_state *ps, struct page *p,
        int count;
 
        result = ps->action(p, pfn);
-       action_result(pfn, ps->msg, result);
 
        count = page_count(p) - 1;
        if (ps->action == me_swapcache_dirty && result == DELAYED)
@@ -871,6 +865,7 @@ static int page_action(struct page_state *ps, struct page *p,
                       pfn, ps->msg, count);
                result = FAILED;
        }
+       action_result(pfn, ps->msg, result);
 
        /* Could do more checks here if page looks ok */
        /*
@@ -1661,7 +1656,7 @@ static int __soft_offline_page(struct page *page, int flags)
                        if (!is_free_buddy_page(page))
                                lru_add_drain_all();
                        if (!is_free_buddy_page(page))
-                               drain_all_pages();
+                               drain_all_pages(page_zone(page));
                        SetPageHWPoison(page);
                        if (!is_free_buddy_page(page))
                                pr_info("soft offline: %#lx: page leaked\n",