From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: [to-be-updated] mm-mremap-calculate-extent-in-one-place.patch removed from -mm tree Date: Mon, 06 Jul 2020 16:03:58 -0700 Message-ID: <20200706230358.1R9bLp7uc%akpm@linux-foundation.org> References: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:55888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbgGFXD7 (ORCPT ); Mon, 6 Jul 2020 19:03:59 -0400 In-Reply-To: <20200703151445.b6a0cfee402c7c5c4651f1b1@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, digetx@gmail.com, kirill.shutemov@linux.intel.com, mm-commits@vger.kernel.org, peterx@redhat.com, richard.weiyang@linux.alibaba.com, sean.j.christopherson@intel.com, thellstrom@vmware.com, thomas_os@shipmail.org, vbabka@suse.cz, walken@google.com, willy@infradead.org, yang.shi@linux.alibaba.com The patch titled Subject: mm/mremap: calculate extent in one place has been removed from the -mm tree. Its filename was mm-mremap-calculate-extent-in-one-place.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Wei Yang Subject: mm/mremap: calculate extent in one place Page tables are moved on the base of PMD. This requires both source and destination range should meet the requirement. Current code works well since move_huge_pmd() and move_normal_pmd() would check old_addr and new_addr again. And then return to move_ptes() if the either of them is not aligned. In stead of calculating the extent separately, it is better to calculate in one place, so we know it is not necessary to try move pmd. By doing so, the logic seems a little clear. Link: http://lkml.kernel.org/r/20200626135216.24314-4-richard.weiyang@linux.alibaba.com Signed-off-by: Wei Yang Tested-by: Dmitry Osipenko Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Michel Lespinasse Cc: Peter Xu Cc: Sean Christopherson Cc: Thomas Hellstrom Cc: Thomas Hellstrom (VMware) Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton --- mm/mremap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/mremap.c~mm-mremap-calculate-extent-in-one-place +++ a/mm/mremap.c @@ -258,6 +258,9 @@ unsigned long move_page_tables(struct vm extent = next - old_addr; if (extent > old_end - old_addr) extent = old_end - old_addr; + next = (new_addr + PMD_SIZE) & PMD_MASK; + if (extent > next - new_addr) + extent = next - new_addr; old_pmd = get_old_pmd(vma->vm_mm, old_addr); if (!old_pmd) continue; @@ -301,9 +304,6 @@ unsigned long move_page_tables(struct vm if (pte_alloc(new_vma->vm_mm, new_pmd)) break; - next = (new_addr + PMD_SIZE) & PMD_MASK; - if (extent > next - new_addr) - extent = next - new_addr; move_ptes(vma, old_pmd, old_addr, old_addr + extent, new_vma, new_pmd, new_addr, need_rmap_locks); } _ Patches currently in -mm which might be from richard.weiyang@linux.alibaba.com are mm-mremap-start-addresses-are-properly-aligned.patch mm-sparse-never-partially-remove-memmap-for-early-section.patch mm-sparse-only-sub-section-aligned-range-would-be-populated.patch mm-page_allocc-replace-the-definition-of-nr_migratetype_bits-with-pb_migratetype_bits.patch mm-page_allocc-extract-the-common-part-in-pfn_to_bitidx.patch mm-page_allocc-simplify-pageblock-bitmap-access.patch mm-page_allocc-remove-unnecessary-end_bitidx-for-_pfnblock_flags_mask.patch mm-page_alloc-fallbacks-at-most-has-3-elements.patch