mm/memcg: fix device private memcg accounting
[linux-2.6-microblaze.git] / mm / memcontrol.c
index c04b57c..7f74a15 100644 (file)
@@ -5516,7 +5516,7 @@ static struct page *mc_handle_swap_pte(struct vm_area_struct *vma,
        struct page *page = NULL;
        swp_entry_t ent = pte_to_swp_entry(ptent);
 
-       if (!(mc.flags & MOVE_ANON) || non_swap_entry(ent))
+       if (!(mc.flags & MOVE_ANON))
                return NULL;
 
        /*
@@ -5535,6 +5535,9 @@ static struct page *mc_handle_swap_pte(struct vm_area_struct *vma,
                return page;
        }
 
+       if (non_swap_entry(ent))
+               return NULL;
+
        /*
         * Because lookup_swap_cache() updates some statistics counter,
         * we call find_get_page() with swapper_space directly.