aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 655fd3d34bb0..d3cb2ef66ee2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -816,20 +816,20 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
816 if (!pte_file(pte)) { 816 if (!pte_file(pte)) {
817 swp_entry_t entry = pte_to_swp_entry(pte); 817 swp_entry_t entry = pte_to_swp_entry(pte);
818 818
819 if (swap_duplicate(entry) < 0) 819 if (likely(!non_swap_entry(entry))) {
820 return entry.val; 820 if (swap_duplicate(entry) < 0)
821 821 return entry.val;
822 /* make sure dst_mm is on swapoff's mmlist. */ 822
823 if (unlikely(list_empty(&dst_mm->mmlist))) { 823 /* make sure dst_mm is on swapoff's mmlist. */
824 spin_lock(&mmlist_lock); 824 if (unlikely(list_empty(&dst_mm->mmlist))) {
825 if (list_empty(&dst_mm->mmlist)) 825 spin_lock(&mmlist_lock);
826 list_add(&dst_mm->mmlist, 826 if (list_empty(&dst_mm->mmlist))
827 &src_mm->mmlist); 827 list_add(&dst_mm->mmlist,
828 spin_unlock(&mmlist_lock); 828 &src_mm->mmlist);
829 } 829 spin_unlock(&mmlist_lock);
830 if (likely(!non_swap_entry(entry))) 830 }
831 rss[MM_SWAPENTS]++; 831 rss[MM_SWAPENTS]++;
832 else if (is_migration_entry(entry)) { 832 } else if (is_migration_entry(entry)) {
833 page = migration_entry_to_page(entry); 833 page = migration_entry_to_page(entry);
834 834
835 if (PageAnon(page)) 835 if (PageAnon(page))