From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 014E7C433E1 for ; Fri, 26 Jun 2020 13:52:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C480A207D8 for ; Fri, 26 Jun 2020 13:52:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C480A207D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2CC0A6B0003; Fri, 26 Jun 2020 09:52:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 254756B0005; Fri, 26 Jun 2020 09:52:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11DBB6B0008; Fri, 26 Jun 2020 09:52:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id EB4D46B0003 for ; Fri, 26 Jun 2020 09:52:41 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 503BE33CD for ; Fri, 26 Jun 2020 13:52:41 +0000 (UTC) X-FDA: 76971503322.28.bear81_340f82126e55 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 28C406C09 for ; Fri, 26 Jun 2020 13:52:41 +0000 (UTC) X-HE-Tag: bear81_340f82126e55 X-Filterd-Recvd-Size: 3044 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 26 Jun 2020 13:52:39 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07425;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0U0lxLZx_1593179552; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U0lxLZx_1593179552) by smtp.aliyun-inc.com(127.0.0.1); Fri, 26 Jun 2020 21:52:32 +0800 From: Wei Yang To: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, yang.shi@linux.alibaba.com, vbabka@suse.cz, willy@infradead.org, thomas_os@shipmail.org, thellstrom@vmware.com, anshuman.khandual@arm.com, sean.j.christopherson@intel.com, aneesh.kumar@linux.ibm.com, peterx@redhat.com, walken@google.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, digetx@gmail.com, Wei Yang Subject: [RESEND Patch v2 4/4] mm/mremap: start addresses are properly aligned Date: Fri, 26 Jun 2020 21:52:16 +0800 Message-Id: <20200626135216.24314-5-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200626135216.24314-1-richard.weiyang@linux.alibaba.com> References: <20200626135216.24314-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 28C406C09 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: After previous cleanup, extent is the minimal step for both source and destination. This means when extent is HPAGE_PMD_SIZE or PMD_SIZE, old_addr and new_addr are properly aligned too. Since these two functions are only invoked in move_page_tables, it is safe to remove the check now. Signed-off-by: Wei Yang Tested-by: Dmitry Osipenko --- mm/huge_memory.c | 3 --- mm/mremap.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 1e580fdad4d0..462a7dbd6350 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1729,9 +1729,6 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsi= gned long old_addr, struct mm_struct *mm =3D vma->vm_mm; bool force_flush =3D false; =20 - if ((old_addr & ~HPAGE_PMD_MASK) || (new_addr & ~HPAGE_PMD_MASK)) - return false; - /* * The destination pmd shouldn't be established, free_pgtables() * should have release it. diff --git a/mm/mremap.c b/mm/mremap.c index a30b3e86cc99..f5f17d050617 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -199,9 +199,6 @@ static bool move_normal_pmd(struct vm_area_struct *vm= a, unsigned long old_addr, struct mm_struct *mm =3D vma->vm_mm; pmd_t pmd; =20 - if ((old_addr & ~PMD_MASK) || (new_addr & ~PMD_MASK)) - return false; - /* * The destination pmd shouldn't be established, free_pgtables() * should have release it. --=20 2.20.1 (Apple Git-117)