diff options
author | Mark Brown <broonie@kernel.org> | 2014-12-17 12:42:03 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-17 12:42:03 +0000 |
commit | 1b8d0e218e8f427b9a12b7086c1b1c4bb832509a (patch) | |
tree | 8a1257b840e817fd2e570a2185f3f0c0b799cb67 /mm/memory.c | |
parent | 94ce80cf9ab62d0b411fa5efcf292eb1cf951a68 (diff) | |
parent | b57438e86302b9a0b175c183827bc4171552d8f9 (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-rt
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 02f8093be672..af9922d54478 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -836,20 +836,20 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, if (!pte_file(pte)) { swp_entry_t entry = pte_to_swp_entry(pte); - if (swap_duplicate(entry) < 0) - return entry.val; - - /* make sure dst_mm is on swapoff's mmlist. */ - if (unlikely(list_empty(&dst_mm->mmlist))) { - spin_lock(&mmlist_lock); - if (list_empty(&dst_mm->mmlist)) - list_add(&dst_mm->mmlist, - &src_mm->mmlist); - spin_unlock(&mmlist_lock); - } - if (likely(!non_swap_entry(entry))) + if (likely(!non_swap_entry(entry))) { + if (swap_duplicate(entry) < 0) + return entry.val; + + /* make sure dst_mm is on swapoff's mmlist. */ + if (unlikely(list_empty(&dst_mm->mmlist))) { + spin_lock(&mmlist_lock); + if (list_empty(&dst_mm->mmlist)) + list_add(&dst_mm->mmlist, + &src_mm->mmlist); + spin_unlock(&mmlist_lock); + } rss[MM_SWAPENTS]++; - else if (is_migration_entry(entry)) { + } else if (is_migration_entry(entry)) { page = migration_entry_to_page(entry); if (PageAnon(page)) |