diff for duplicates of <20141224140205.92CDBA6@black.fi.intel.com> diff --git a/a/1.txt b/N1/1.txt index e087fb8..8b13789 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,339 +1 @@ -From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001 -From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> -Date: Tue, 23 Dec 2014 13:32:55 +0200 - -One bit in ->vm_flags is unused now! - -Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> ---- - -v2: fix warning on !CONFIG_SWAP - ---- - drivers/gpu/drm/drm_vma_manager.c | 3 +- - include/linux/mm.h | 1 - - include/linux/swapops.h | 4 +- - mm/debug.c | 1 - - mm/gup.c | 2 +- - mm/ksm.c | 2 +- - mm/madvise.c | 4 +- - mm/memcontrol.c | 4 +- - mm/memory.c | 78 +++++++++++++++++++-------------------- - mm/mincore.c | 9 +---- - mm/mprotect.c | 2 +- - mm/mremap.c | 2 - - mm/msync.c | 5 +-- - 13 files changed, 48 insertions(+), 69 deletions(-) - -diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c -index 63b471205072..68c1f32fb086 100644 ---- a/drivers/gpu/drm/drm_vma_manager.c -+++ b/drivers/gpu/drm/drm_vma_manager.c -@@ -50,8 +50,7 @@ - * - * You must not use multiple offset managers on a single address_space. - * Otherwise, mm-core will be unable to tear down memory mappings as the VM will -- * no longer be linear. Please use VM_NONLINEAR in that case and implement your -- * own offset managers. -+ * no longer be linear. - * - * This offset manager works on page-based addresses. That is, every argument - * and return code (with the exception of drm_vma_node_offset_addr()) is given -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 6840c0dc8a06..43338946cb83 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -138,7 +138,6 @@ extern unsigned int kobjsize(const void *objp); - #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ - #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ - #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ --#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ - #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ - #define VM_ARCH_2 0x02000000 - #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ -diff --git a/include/linux/swapops.h b/include/linux/swapops.h -index 6adfb7bfbf44..50cbc876be56 100644 ---- a/include/linux/swapops.h -+++ b/include/linux/swapops.h -@@ -54,7 +54,7 @@ static inline pgoff_t swp_offset(swp_entry_t entry) - /* check whether a pte points to a swap entry */ - static inline int is_swap_pte(pte_t pte) - { -- return !pte_none(pte) && !pte_present_nonuma(pte) && !pte_file(pte); -+ return !pte_none(pte) && !pte_present_nonuma(pte); - } - #endif - -@@ -66,7 +66,6 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte) - { - swp_entry_t arch_entry; - -- BUG_ON(pte_file(pte)); - if (pte_swp_soft_dirty(pte)) - pte = pte_swp_clear_soft_dirty(pte); - arch_entry = __pte_to_swp_entry(pte); -@@ -82,7 +81,6 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) - swp_entry_t arch_entry; - - arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); -- BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); - return __swp_entry_to_pte(arch_entry); - } - -diff --git a/mm/debug.c b/mm/debug.c -index 0e58f3211f89..d69cb5a7ba9a 100644 ---- a/mm/debug.c -+++ b/mm/debug.c -@@ -130,7 +130,6 @@ static const struct trace_print_flags vmaflags_names[] = { - {VM_ACCOUNT, "account" }, - {VM_NORESERVE, "noreserve" }, - {VM_HUGETLB, "hugetlb" }, -- {VM_NONLINEAR, "nonlinear" }, - #if defined(CONFIG_X86) - {VM_PAT, "pat" }, - #elif defined(CONFIG_PPC) -diff --git a/mm/gup.c b/mm/gup.c -index a900759cc807..f8b2838c88fa 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -55,7 +55,7 @@ retry: - */ - if (likely(!(flags & FOLL_MIGRATION))) - goto no_page; -- if (pte_none(pte) || pte_file(pte)) -+ if (pte_none(pte)) - goto no_page; - entry = pte_to_swp_entry(pte); - if (!is_migration_entry(entry)) -diff --git a/mm/ksm.c b/mm/ksm.c -index d247efab5073..2d12da1fda05 100644 ---- a/mm/ksm.c -+++ b/mm/ksm.c -@@ -1748,7 +1748,7 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start, - */ - if (*vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE | - VM_PFNMAP | VM_IO | VM_DONTEXPAND | -- VM_HUGETLB | VM_NONLINEAR | VM_MIXEDMAP)) -+ VM_HUGETLB | VM_MIXEDMAP)) - return 0; /* just ignore the advice */ - - #ifdef VM_SAO -diff --git a/mm/madvise.c b/mm/madvise.c -index 8d74d7617598..d03e1bbd3af3 100644 ---- a/mm/madvise.c -+++ b/mm/madvise.c -@@ -164,7 +164,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start, - pte = *(orig_pte + ((index - start) / PAGE_SIZE)); - pte_unmap_unlock(orig_pte, ptl); - -- if (pte_present(pte) || pte_none(pte) || pte_file(pte)) -+ if (pte_present(pte) || pte_none(pte)) - continue; - entry = pte_to_swp_entry(pte); - if (unlikely(non_swap_entry(entry))) -@@ -437,7 +437,7 @@ static long madvise_remove(struct vm_area_struct *vma, - - *prev = NULL; /* tell sys_madvise we drop mmap_sem */ - -- if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) -+ if (vma->vm_flags & (VM_LOCKED | VM_HUGETLB)) - return -EINVAL; - - f = vma->vm_file; -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index ef91e856c7e4..408f189d24eb 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -4937,8 +4937,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, - mapping = vma->vm_file->f_mapping; - if (pte_none(ptent)) - pgoff = linear_page_index(vma, addr); -- else /* pte_file(ptent) is true */ -- pgoff = pte_to_pgoff(ptent); - - /* page is moved even if it's not RSS of this task(page-faulted). */ - #ifdef CONFIG_SWAP -@@ -4970,7 +4968,7 @@ static enum mc_target_type get_mctgt_type(struct vm_area_struct *vma, - page = mc_handle_present_pte(vma, addr, ptent); - else if (is_swap_pte(ptent)) - page = mc_handle_swap_pte(vma, addr, ptent, &ent); -- else if (pte_none(ptent) || pte_file(ptent)) -+ else if (pte_none(ptent)) - page = mc_handle_file_pte(vma, addr, ptent, &ent); - - if (!page && !ent.val) -diff --git a/mm/memory.c b/mm/memory.c -index 587522630b10..f70c9568ea31 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -811,42 +811,40 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, - - /* pte contains position in swap or file, so copy. */ - if (unlikely(!pte_present(pte))) { -- if (!pte_file(pte)) { -- swp_entry_t entry = pte_to_swp_entry(pte); -- -- 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)) { -- page = migration_entry_to_page(entry); -- -- if (PageAnon(page)) -- rss[MM_ANONPAGES]++; -- else -- rss[MM_FILEPAGES]++; -- -- if (is_write_migration_entry(entry) && -- is_cow_mapping(vm_flags)) { -- /* -- * COW mappings require pages in both -- * parent and child to be set to read. -- */ -- make_migration_entry_read(&entry); -- pte = swp_entry_to_pte(entry); -- if (pte_swp_soft_dirty(*src_pte)) -- pte = pte_swp_mksoft_dirty(pte); -- set_pte_at(src_mm, addr, src_pte, pte); -- } -+ swp_entry_t entry = pte_to_swp_entry(pte); -+ -+ 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)) { -+ page = migration_entry_to_page(entry); -+ -+ if (PageAnon(page)) -+ rss[MM_ANONPAGES]++; -+ else -+ rss[MM_FILEPAGES]++; -+ -+ if (is_write_migration_entry(entry) && -+ is_cow_mapping(vm_flags)) { -+ /* -+ * COW mappings require pages in both -+ * parent and child to be set to read. -+ */ -+ make_migration_entry_read(&entry); -+ pte = swp_entry_to_pte(entry); -+ if (pte_swp_soft_dirty(*src_pte)) -+ pte = pte_swp_mksoft_dirty(pte); -+ set_pte_at(src_mm, addr, src_pte, pte); - } - } - goto out_set_pte; -@@ -1020,11 +1018,9 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, - * readonly mappings. The tradeoff is that copy_page_range is more - * efficient than faulting. - */ -- if (!(vma->vm_flags & (VM_HUGETLB | VM_NONLINEAR | -- VM_PFNMAP | VM_MIXEDMAP))) { -- if (!vma->anon_vma) -- return 0; -- } -+ if (!(vma->vm_flags & (VM_HUGETLB | VM_PFNMAP | VM_MIXEDMAP)) && -+ !vma->anon_vma) -+ return 0; - - if (is_vm_hugetlb_page(vma)) - return copy_hugetlb_page_range(dst_mm, src_mm, vma); -diff --git a/mm/mincore.c b/mm/mincore.c -index c8c528b36641..46527c023e0c 100644 ---- a/mm/mincore.c -+++ b/mm/mincore.c -@@ -124,17 +124,13 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd, - ptep = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); - do { - pte_t pte = *ptep; -- pgoff_t pgoff; - - next = addr + PAGE_SIZE; - if (pte_none(pte)) - mincore_unmapped_range(vma, addr, next, vec); - else if (pte_present(pte)) - *vec = 1; -- else if (pte_file(pte)) { -- pgoff = pte_to_pgoff(pte); -- *vec = mincore_page(vma->vm_file->f_mapping, pgoff); -- } else { /* pte is a swap entry */ -+ else { /* pte is a swap entry */ - swp_entry_t entry = pte_to_swp_entry(pte); - - if (non_swap_entry(entry)) { -@@ -145,9 +141,8 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd, - *vec = 1; - } else { - #ifdef CONFIG_SWAP -- pgoff = entry.val; - *vec = mincore_page(swap_address_space(entry), -- pgoff); -+ entry.val); - #else - WARN_ON(1); - *vec = 1; -diff --git a/mm/mprotect.c b/mm/mprotect.c -index ace93454ce8e..33121662f08b 100644 ---- a/mm/mprotect.c -+++ b/mm/mprotect.c -@@ -105,7 +105,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, - } - if (updated) - pages++; -- } else if (IS_ENABLED(CONFIG_MIGRATION) && !pte_file(oldpte)) { -+ } else if (IS_ENABLED(CONFIG_MIGRATION)) { - swp_entry_t entry = pte_to_swp_entry(oldpte); - - if (is_write_migration_entry(entry)) { -diff --git a/mm/mremap.c b/mm/mremap.c -index 17fa018f5f39..57dadc025c64 100644 ---- a/mm/mremap.c -+++ b/mm/mremap.c -@@ -81,8 +81,6 @@ static pte_t move_soft_dirty_pte(pte_t pte) - pte = pte_mksoft_dirty(pte); - else if (is_swap_pte(pte)) - pte = pte_swp_mksoft_dirty(pte); -- else if (pte_file(pte)) -- pte = pte_file_mksoft_dirty(pte); - #endif - return pte; - } -diff --git a/mm/msync.c b/mm/msync.c -index 992a1673d488..bb04d53ae852 100644 ---- a/mm/msync.c -+++ b/mm/msync.c -@@ -86,10 +86,7 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) - (vma->vm_flags & VM_SHARED)) { - get_file(file); - up_read(&mm->mmap_sem); -- if (vma->vm_flags & VM_NONLINEAR) -- error = vfs_fsync(file, 1); -- else -- error = vfs_fsync_range(file, fstart, fend, 1); -+ error = vfs_fsync_range(file, fstart, fend, 1); - fput(file); - if (error || start >= end) - goto out; --- -2.1.3 diff --git a/a/content_digest b/N1/content_digest index 17cae53..812e78c 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,6 +3,7 @@ "From\0Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\0" "Subject\0[PATCHv2 07/38] mm: remove rest usage of VM_NONLINEAR and pte_file()\0" "Date\0Wed, 24 Dec 2014 16:02:05 +0200 (EET)\0" + "To\0Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\0" "Cc\0akpm@linux-foundation.org" peterz@infradead.org mingo@kernel.org @@ -11,348 +12,8 @@ hughd@google.com linux-mm@kvack.org linux-arch@vger.kernel.org - linux-kernel@vger.kernel.org - " Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\0" + " linux-kernel@vger.kernel.org\0" "\00:1\0" "b\0" - "\n" - "From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001\n" - "From: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\n" - "Date: Tue, 23 Dec 2014 13:32:55 +0200\n" - "\n" - "One bit in ->vm_flags is unused now!\n" - "\n" - "Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n" - "---\n" - "\n" - "v2: fix warning on !CONFIG_SWAP\n" - "\n" - "---\n" - " drivers/gpu/drm/drm_vma_manager.c | 3 +-\n" - " include/linux/mm.h | 1 -\n" - " include/linux/swapops.h | 4 +-\n" - " mm/debug.c | 1 -\n" - " mm/gup.c | 2 +-\n" - " mm/ksm.c | 2 +-\n" - " mm/madvise.c | 4 +-\n" - " mm/memcontrol.c | 4 +-\n" - " mm/memory.c | 78 +++++++++++++++++++--------------------\n" - " mm/mincore.c | 9 +----\n" - " mm/mprotect.c | 2 +-\n" - " mm/mremap.c | 2 -\n" - " mm/msync.c | 5 +--\n" - " 13 files changed, 48 insertions(+), 69 deletions(-)\n" - "\n" - "diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c\n" - "index 63b471205072..68c1f32fb086 100644\n" - "--- a/drivers/gpu/drm/drm_vma_manager.c\n" - "+++ b/drivers/gpu/drm/drm_vma_manager.c\n" - "@@ -50,8 +50,7 @@\n" - " *\n" - " * You must not use multiple offset managers on a single address_space.\n" - " * Otherwise, mm-core will be unable to tear down memory mappings as the VM will\n" - "- * no longer be linear. Please use VM_NONLINEAR in that case and implement your\n" - "- * own offset managers.\n" - "+ * no longer be linear.\n" - " *\n" - " * This offset manager works on page-based addresses. That is, every argument\n" - " * and return code (with the exception of drm_vma_node_offset_addr()) is given\n" - "diff --git a/include/linux/mm.h b/include/linux/mm.h\n" - "index 6840c0dc8a06..43338946cb83 100644\n" - "--- a/include/linux/mm.h\n" - "+++ b/include/linux/mm.h\n" - "@@ -138,7 +138,6 @@ extern unsigned int kobjsize(const void *objp);\n" - " #define VM_ACCOUNT\t0x00100000\t/* Is a VM accounted object */\n" - " #define VM_NORESERVE\t0x00200000\t/* should the VM suppress accounting */\n" - " #define VM_HUGETLB\t0x00400000\t/* Huge TLB Page VM */\n" - "-#define VM_NONLINEAR\t0x00800000\t/* Is non-linear (remap_file_pages) */\n" - " #define VM_ARCH_1\t0x01000000\t/* Architecture-specific flag */\n" - " #define VM_ARCH_2\t0x02000000\n" - " #define VM_DONTDUMP\t0x04000000\t/* Do not include in the core dump */\n" - "diff --git a/include/linux/swapops.h b/include/linux/swapops.h\n" - "index 6adfb7bfbf44..50cbc876be56 100644\n" - "--- a/include/linux/swapops.h\n" - "+++ b/include/linux/swapops.h\n" - "@@ -54,7 +54,7 @@ static inline pgoff_t swp_offset(swp_entry_t entry)\n" - " /* check whether a pte points to a swap entry */\n" - " static inline int is_swap_pte(pte_t pte)\n" - " {\n" - "-\treturn !pte_none(pte) && !pte_present_nonuma(pte) && !pte_file(pte);\n" - "+\treturn !pte_none(pte) && !pte_present_nonuma(pte);\n" - " }\n" - " #endif\n" - " \n" - "@@ -66,7 +66,6 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte)\n" - " {\n" - " \tswp_entry_t arch_entry;\n" - " \n" - "-\tBUG_ON(pte_file(pte));\n" - " \tif (pte_swp_soft_dirty(pte))\n" - " \t\tpte = pte_swp_clear_soft_dirty(pte);\n" - " \tarch_entry = __pte_to_swp_entry(pte);\n" - "@@ -82,7 +81,6 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)\n" - " \tswp_entry_t arch_entry;\n" - " \n" - " \tarch_entry = __swp_entry(swp_type(entry), swp_offset(entry));\n" - "-\tBUG_ON(pte_file(__swp_entry_to_pte(arch_entry)));\n" - " \treturn __swp_entry_to_pte(arch_entry);\n" - " }\n" - " \n" - "diff --git a/mm/debug.c b/mm/debug.c\n" - "index 0e58f3211f89..d69cb5a7ba9a 100644\n" - "--- a/mm/debug.c\n" - "+++ b/mm/debug.c\n" - "@@ -130,7 +130,6 @@ static const struct trace_print_flags vmaflags_names[] = {\n" - " \t{VM_ACCOUNT,\t\t\t\"account\"\t},\n" - " \t{VM_NORESERVE,\t\t\t\"noreserve\"\t},\n" - " \t{VM_HUGETLB,\t\t\t\"hugetlb\"\t},\n" - "-\t{VM_NONLINEAR,\t\t\t\"nonlinear\"\t},\n" - " #if defined(CONFIG_X86)\n" - " \t{VM_PAT,\t\t\t\"pat\"\t\t},\n" - " #elif defined(CONFIG_PPC)\n" - "diff --git a/mm/gup.c b/mm/gup.c\n" - "index a900759cc807..f8b2838c88fa 100644\n" - "--- a/mm/gup.c\n" - "+++ b/mm/gup.c\n" - "@@ -55,7 +55,7 @@ retry:\n" - " \t\t */\n" - " \t\tif (likely(!(flags & FOLL_MIGRATION)))\n" - " \t\t\tgoto no_page;\n" - "-\t\tif (pte_none(pte) || pte_file(pte))\n" - "+\t\tif (pte_none(pte))\n" - " \t\t\tgoto no_page;\n" - " \t\tentry = pte_to_swp_entry(pte);\n" - " \t\tif (!is_migration_entry(entry))\n" - "diff --git a/mm/ksm.c b/mm/ksm.c\n" - "index d247efab5073..2d12da1fda05 100644\n" - "--- a/mm/ksm.c\n" - "+++ b/mm/ksm.c\n" - "@@ -1748,7 +1748,7 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start,\n" - " \t\t */\n" - " \t\tif (*vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE |\n" - " \t\t\t\t VM_PFNMAP | VM_IO | VM_DONTEXPAND |\n" - "-\t\t\t\t VM_HUGETLB | VM_NONLINEAR | VM_MIXEDMAP))\n" - "+\t\t\t\t VM_HUGETLB | VM_MIXEDMAP))\n" - " \t\t\treturn 0;\t\t/* just ignore the advice */\n" - " \n" - " #ifdef VM_SAO\n" - "diff --git a/mm/madvise.c b/mm/madvise.c\n" - "index 8d74d7617598..d03e1bbd3af3 100644\n" - "--- a/mm/madvise.c\n" - "+++ b/mm/madvise.c\n" - "@@ -164,7 +164,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,\n" - " \t\tpte = *(orig_pte + ((index - start) / PAGE_SIZE));\n" - " \t\tpte_unmap_unlock(orig_pte, ptl);\n" - " \n" - "-\t\tif (pte_present(pte) || pte_none(pte) || pte_file(pte))\n" - "+\t\tif (pte_present(pte) || pte_none(pte))\n" - " \t\t\tcontinue;\n" - " \t\tentry = pte_to_swp_entry(pte);\n" - " \t\tif (unlikely(non_swap_entry(entry)))\n" - "@@ -437,7 +437,7 @@ static long madvise_remove(struct vm_area_struct *vma,\n" - " \n" - " \t*prev = NULL;\t/* tell sys_madvise we drop mmap_sem */\n" - " \n" - "-\tif (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))\n" - "+\tif (vma->vm_flags & (VM_LOCKED | VM_HUGETLB))\n" - " \t\treturn -EINVAL;\n" - " \n" - " \tf = vma->vm_file;\n" - "diff --git a/mm/memcontrol.c b/mm/memcontrol.c\n" - "index ef91e856c7e4..408f189d24eb 100644\n" - "--- a/mm/memcontrol.c\n" - "+++ b/mm/memcontrol.c\n" - "@@ -4937,8 +4937,6 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma,\n" - " \tmapping = vma->vm_file->f_mapping;\n" - " \tif (pte_none(ptent))\n" - " \t\tpgoff = linear_page_index(vma, addr);\n" - "-\telse /* pte_file(ptent) is true */\n" - "-\t\tpgoff = pte_to_pgoff(ptent);\n" - " \n" - " \t/* page is moved even if it's not RSS of this task(page-faulted). */\n" - " #ifdef CONFIG_SWAP\n" - "@@ -4970,7 +4968,7 @@ static enum mc_target_type get_mctgt_type(struct vm_area_struct *vma,\n" - " \t\tpage = mc_handle_present_pte(vma, addr, ptent);\n" - " \telse if (is_swap_pte(ptent))\n" - " \t\tpage = mc_handle_swap_pte(vma, addr, ptent, &ent);\n" - "-\telse if (pte_none(ptent) || pte_file(ptent))\n" - "+\telse if (pte_none(ptent))\n" - " \t\tpage = mc_handle_file_pte(vma, addr, ptent, &ent);\n" - " \n" - " \tif (!page && !ent.val)\n" - "diff --git a/mm/memory.c b/mm/memory.c\n" - "index 587522630b10..f70c9568ea31 100644\n" - "--- a/mm/memory.c\n" - "+++ b/mm/memory.c\n" - "@@ -811,42 +811,40 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,\n" - " \n" - " \t/* pte contains position in swap or file, so copy. */\n" - " \tif (unlikely(!pte_present(pte))) {\n" - "-\t\tif (!pte_file(pte)) {\n" - "-\t\t\tswp_entry_t entry = pte_to_swp_entry(pte);\n" - "-\n" - "-\t\t\tif (likely(!non_swap_entry(entry))) {\n" - "-\t\t\t\tif (swap_duplicate(entry) < 0)\n" - "-\t\t\t\t\treturn entry.val;\n" - "-\n" - "-\t\t\t\t/* make sure dst_mm is on swapoff's mmlist. */\n" - "-\t\t\t\tif (unlikely(list_empty(&dst_mm->mmlist))) {\n" - "-\t\t\t\t\tspin_lock(&mmlist_lock);\n" - "-\t\t\t\t\tif (list_empty(&dst_mm->mmlist))\n" - "-\t\t\t\t\t\tlist_add(&dst_mm->mmlist,\n" - "-\t\t\t\t\t\t\t &src_mm->mmlist);\n" - "-\t\t\t\t\tspin_unlock(&mmlist_lock);\n" - "-\t\t\t\t}\n" - "-\t\t\t\trss[MM_SWAPENTS]++;\n" - "-\t\t\t} else if (is_migration_entry(entry)) {\n" - "-\t\t\t\tpage = migration_entry_to_page(entry);\n" - "-\n" - "-\t\t\t\tif (PageAnon(page))\n" - "-\t\t\t\t\trss[MM_ANONPAGES]++;\n" - "-\t\t\t\telse\n" - "-\t\t\t\t\trss[MM_FILEPAGES]++;\n" - "-\n" - "-\t\t\t\tif (is_write_migration_entry(entry) &&\n" - "-\t\t\t\t is_cow_mapping(vm_flags)) {\n" - "-\t\t\t\t\t/*\n" - "-\t\t\t\t\t * COW mappings require pages in both\n" - "-\t\t\t\t\t * parent and child to be set to read.\n" - "-\t\t\t\t\t */\n" - "-\t\t\t\t\tmake_migration_entry_read(&entry);\n" - "-\t\t\t\t\tpte = swp_entry_to_pte(entry);\n" - "-\t\t\t\t\tif (pte_swp_soft_dirty(*src_pte))\n" - "-\t\t\t\t\t\tpte = pte_swp_mksoft_dirty(pte);\n" - "-\t\t\t\t\tset_pte_at(src_mm, addr, src_pte, pte);\n" - "-\t\t\t\t}\n" - "+\t\tswp_entry_t entry = pte_to_swp_entry(pte);\n" - "+\n" - "+\t\tif (likely(!non_swap_entry(entry))) {\n" - "+\t\t\tif (swap_duplicate(entry) < 0)\n" - "+\t\t\t\treturn entry.val;\n" - "+\n" - "+\t\t\t/* make sure dst_mm is on swapoff's mmlist. */\n" - "+\t\t\tif (unlikely(list_empty(&dst_mm->mmlist))) {\n" - "+\t\t\t\tspin_lock(&mmlist_lock);\n" - "+\t\t\t\tif (list_empty(&dst_mm->mmlist))\n" - "+\t\t\t\t\tlist_add(&dst_mm->mmlist,\n" - "+\t\t\t\t\t\t\t&src_mm->mmlist);\n" - "+\t\t\t\tspin_unlock(&mmlist_lock);\n" - "+\t\t\t}\n" - "+\t\t\trss[MM_SWAPENTS]++;\n" - "+\t\t} else if (is_migration_entry(entry)) {\n" - "+\t\t\tpage = migration_entry_to_page(entry);\n" - "+\n" - "+\t\t\tif (PageAnon(page))\n" - "+\t\t\t\trss[MM_ANONPAGES]++;\n" - "+\t\t\telse\n" - "+\t\t\t\trss[MM_FILEPAGES]++;\n" - "+\n" - "+\t\t\tif (is_write_migration_entry(entry) &&\n" - "+\t\t\t\t\tis_cow_mapping(vm_flags)) {\n" - "+\t\t\t\t/*\n" - "+\t\t\t\t * COW mappings require pages in both\n" - "+\t\t\t\t * parent and child to be set to read.\n" - "+\t\t\t\t */\n" - "+\t\t\t\tmake_migration_entry_read(&entry);\n" - "+\t\t\t\tpte = swp_entry_to_pte(entry);\n" - "+\t\t\t\tif (pte_swp_soft_dirty(*src_pte))\n" - "+\t\t\t\t\tpte = pte_swp_mksoft_dirty(pte);\n" - "+\t\t\t\tset_pte_at(src_mm, addr, src_pte, pte);\n" - " \t\t\t}\n" - " \t\t}\n" - " \t\tgoto out_set_pte;\n" - "@@ -1020,11 +1018,9 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,\n" - " \t * readonly mappings. The tradeoff is that copy_page_range is more\n" - " \t * efficient than faulting.\n" - " \t */\n" - "-\tif (!(vma->vm_flags & (VM_HUGETLB | VM_NONLINEAR |\n" - "-\t\t\t VM_PFNMAP | VM_MIXEDMAP))) {\n" - "-\t\tif (!vma->anon_vma)\n" - "-\t\t\treturn 0;\n" - "-\t}\n" - "+\tif (!(vma->vm_flags & (VM_HUGETLB | VM_PFNMAP | VM_MIXEDMAP)) &&\n" - "+\t\t\t!vma->anon_vma)\n" - "+\t\treturn 0;\n" - " \n" - " \tif (is_vm_hugetlb_page(vma))\n" - " \t\treturn copy_hugetlb_page_range(dst_mm, src_mm, vma);\n" - "diff --git a/mm/mincore.c b/mm/mincore.c\n" - "index c8c528b36641..46527c023e0c 100644\n" - "--- a/mm/mincore.c\n" - "+++ b/mm/mincore.c\n" - "@@ -124,17 +124,13 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,\n" - " \tptep = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);\n" - " \tdo {\n" - " \t\tpte_t pte = *ptep;\n" - "-\t\tpgoff_t pgoff;\n" - " \n" - " \t\tnext = addr + PAGE_SIZE;\n" - " \t\tif (pte_none(pte))\n" - " \t\t\tmincore_unmapped_range(vma, addr, next, vec);\n" - " \t\telse if (pte_present(pte))\n" - " \t\t\t*vec = 1;\n" - "-\t\telse if (pte_file(pte)) {\n" - "-\t\t\tpgoff = pte_to_pgoff(pte);\n" - "-\t\t\t*vec = mincore_page(vma->vm_file->f_mapping, pgoff);\n" - "-\t\t} else { /* pte is a swap entry */\n" - "+\t\telse { /* pte is a swap entry */\n" - " \t\t\tswp_entry_t entry = pte_to_swp_entry(pte);\n" - " \n" - " \t\t\tif (non_swap_entry(entry)) {\n" - "@@ -145,9 +141,8 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,\n" - " \t\t\t\t*vec = 1;\n" - " \t\t\t} else {\n" - " #ifdef CONFIG_SWAP\n" - "-\t\t\t\tpgoff = entry.val;\n" - " \t\t\t\t*vec = mincore_page(swap_address_space(entry),\n" - "-\t\t\t\t\tpgoff);\n" - "+\t\t\t\t\tentry.val);\n" - " #else\n" - " \t\t\t\tWARN_ON(1);\n" - " \t\t\t\t*vec = 1;\n" - "diff --git a/mm/mprotect.c b/mm/mprotect.c\n" - "index ace93454ce8e..33121662f08b 100644\n" - "--- a/mm/mprotect.c\n" - "+++ b/mm/mprotect.c\n" - "@@ -105,7 +105,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,\n" - " \t\t\t}\n" - " \t\t\tif (updated)\n" - " \t\t\t\tpages++;\n" - "-\t\t} else if (IS_ENABLED(CONFIG_MIGRATION) && !pte_file(oldpte)) {\n" - "+\t\t} else if (IS_ENABLED(CONFIG_MIGRATION)) {\n" - " \t\t\tswp_entry_t entry = pte_to_swp_entry(oldpte);\n" - " \n" - " \t\t\tif (is_write_migration_entry(entry)) {\n" - "diff --git a/mm/mremap.c b/mm/mremap.c\n" - "index 17fa018f5f39..57dadc025c64 100644\n" - "--- a/mm/mremap.c\n" - "+++ b/mm/mremap.c\n" - "@@ -81,8 +81,6 @@ static pte_t move_soft_dirty_pte(pte_t pte)\n" - " \t\tpte = pte_mksoft_dirty(pte);\n" - " \telse if (is_swap_pte(pte))\n" - " \t\tpte = pte_swp_mksoft_dirty(pte);\n" - "-\telse if (pte_file(pte))\n" - "-\t\tpte = pte_file_mksoft_dirty(pte);\n" - " #endif\n" - " \treturn pte;\n" - " }\n" - "diff --git a/mm/msync.c b/mm/msync.c\n" - "index 992a1673d488..bb04d53ae852 100644\n" - "--- a/mm/msync.c\n" - "+++ b/mm/msync.c\n" - "@@ -86,10 +86,7 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)\n" - " \t\t\t\t(vma->vm_flags & VM_SHARED)) {\n" - " \t\t\tget_file(file);\n" - " \t\t\tup_read(&mm->mmap_sem);\n" - "-\t\t\tif (vma->vm_flags & VM_NONLINEAR)\n" - "-\t\t\t\terror = vfs_fsync(file, 1);\n" - "-\t\t\telse\n" - "-\t\t\t\terror = vfs_fsync_range(file, fstart, fend, 1);\n" - "+\t\t\terror = vfs_fsync_range(file, fstart, fend, 1);\n" - " \t\t\tfput(file);\n" - " \t\t\tif (error || start >= end)\n" - " \t\t\t\tgoto out;\n" - "-- \n" - 2.1.3 -c981396a8e0c580919a9f0fb772564c5d860ee3854bc4920b48c58eaef92c38e +3c93aadee950e5c0dae87c3470fef3e1b030e8a34772a9c7a5e8ed357041b555
diff --git a/a/1.txt b/N2/1.txt index e087fb8..252d5a9 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,5 +1,5 @@ -From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001 +>From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Date: Tue, 23 Dec 2014 13:32:55 +0200 diff --git a/a/content_digest b/N2/content_digest index 17cae53..cde29f8 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -3,6 +3,7 @@ "From\0Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\0" "Subject\0[PATCHv2 07/38] mm: remove rest usage of VM_NONLINEAR and pte_file()\0" "Date\0Wed, 24 Dec 2014 16:02:05 +0200 (EET)\0" + "To\0Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\0" "Cc\0akpm@linux-foundation.org" peterz@infradead.org mingo@kernel.org @@ -16,7 +17,7 @@ "\00:1\0" "b\0" "\n" - "From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001\n" + ">From a7006b3b91e72963dc5f4756aaeae71af2d28b60 Mon Sep 17 00:00:00 2001\n" "From: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\n" "Date: Tue, 23 Dec 2014 13:32:55 +0200\n" "\n" @@ -355,4 +356,4 @@ "-- \n" 2.1.3 -c981396a8e0c580919a9f0fb772564c5d860ee3854bc4920b48c58eaef92c38e +4c150b2c8748f1348d11cdb11fa7cebe7397e54debf4439acf000667faee978b
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.