Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp994324ybl; Tue, 28 Jan 2020 16:28:28 -0800 (PST) X-Google-Smtp-Source: APXvYqw0sGIjlPuI3d5RZB9oZ8/qIWRalzTRES8aQfZcw63W4iiGb5xpIapfQ8IKCxI75tdh2wJ3 X-Received: by 2002:aca:f517:: with SMTP id t23mr4548013oih.160.1580257707898; Tue, 28 Jan 2020 16:28:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580257707; cv=none; d=google.com; s=arc-20160816; b=wkFj2OoKJpzYCXmygNXCK6JYXabSpsI/NbPUsciDdkbRfeKd5dQ6X4YLE8JYtbN2Pg 3Gaq7TdYBUlaCC72fO/BX4s/t1iWutBEPKihM/IqHP45DAONj/aVF+/vGvmKgXiD663W fUNsa3WnncMydB5u1/WSVYutP+pNpg+j3omEihUrXWs/EjXgLe/CdzdJAkR47i0NhCqC YCxjjUZcLPhpjnbJfScNBAGGd/X8lniSDwqMl9WVsGDXlnZbEiuHAWDy2YT8Gph4hf7t fppkaWPRpstY5uLlo8veL9TZLNT5No/zj5H5FSz8MUm0jrgz25r3HgJUm8PmJ8NSQPL8 E4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Q+9uVuSDcmSr8SeAoc9SZoy40vqT4ZADzFlVKEp92dM=; b=QGykd04ZM9ao80x9DWByTqjsB/0uLboIr2yR4UdoePMlxJsfCdfuEDGS3pDscClJUM 8Oj7ZJdX2jhqDld+WHUyA2ZUdA3k7TOgJophu9D3Sj4XN/53UBDV3YVK3lwbVf0gKOPk xXxDspdkprHSEBF4r9mY76iqBfq/U2i4UxYCsIWkn1o85Ut4yr8jCYIgHEEHnI7rGg3+ 9jPLr8gyt0ehYSFOiyOhnZRMhi1OjAoauj1Jzub+V40qLHh701bYgQY90L88cUaYN/+B MWxxVNkBCy31zPBqvpYe6Ep8OpruABQejhVb+++qM4+425dqMRukLiQONxNZMm1u39dD T6Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si244555oic.77.2020.01.28.16.28.15; Tue, 28 Jan 2020 16:28:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbgA2A1U (ORCPT + 99 others); Tue, 28 Jan 2020 19:27:20 -0500 Received: from mga11.intel.com ([192.55.52.93]:12087 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgA2A1S (ORCPT ); Tue, 28 Jan 2020 19:27:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 16:27:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,375,1574150400"; d="scan'208";a="229456113" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga003.jf.intel.com with ESMTP; 28 Jan 2020 16:27:15 -0800 From: Wei Yang To: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, kirill@shutemov.name, dan.j.williams@intel.com, yang.shi@linux.alibaba.com, thellstrom@vmware.com, richardw.yang@linux.intel.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, digetx@gmail.com Subject: [Patch v2 4/4] mm/mremap: start addresses are properly aligned Date: Wed, 29 Jan 2020 08:26:42 +0800 Message-Id: <20200129002642.13508-5-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200129002642.13508-1-richardw.yang@linux.intel.com> References: <20200129002642.13508-1-richardw.yang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 8f1bbbf01f5b..cc98d0f07d0a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1878,9 +1878,6 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, struct mm_struct *mm = vma->vm_mm; bool force_flush = false; - 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 b2f3344d090a..7510f4e03fca 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -199,9 +199,6 @@ static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr, struct mm_struct *mm = vma->vm_mm; pmd_t pmd; - if ((old_addr & ~PMD_MASK) || (new_addr & ~PMD_MASK)) - return false; - /* * The destination pmd shouldn't be established, free_pgtables() * should have release it. -- 2.17.1