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