Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9613949ybl; Fri, 17 Jan 2020 15:24:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwDeIsg4hVnde87Js5DtwRC+5JzonTeg2mmEEHuO4LZNZbgIRYcRMHFc/7mLVZMQUqRzOfl X-Received: by 2002:aca:388:: with SMTP id 130mr5071085oid.89.1579303475448; Fri, 17 Jan 2020 15:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579303475; cv=none; d=google.com; s=arc-20160816; b=wOEXjF1NHBIYfxgM+WY08ekik2V8DpF96eGcPZfqKQLuQlz2JQupt+K4GvMhVaFHgy CRf0GCLx/nqUXYWplWfU22bEdjVp13Ie75UEW9nQ4lb51e84mM1ZzlZEAu3e4Y/31ZBR z2rvMRLSX5VE4rhQjlSOvAZw0eHkAGhqnyktcNvzv3n4ExCAYVPCXrLmvNPorTgNRMQ3 bMFzw0eWhJAHfNw4INI4o1FXcUr7tCmENYSDKBF65v9sh7rgZDjOnJohLyi3/QhJtNkQ vY/qk7PnapBiwPruBwaFa62ETQ2b2CzDnsH8CciyjdpxAjcJzL7Ec1uLIm6urgc9nI/O jvNw== 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=HeCeqFLb58whvz4O7JB7/+t4GDfDp4togTM5uxVBRMo=; b=hgSCYJDhP1nNgjdTSCotr7ffACLlArIX0a3or7Pmwh/D/J1e6DcDqXV6T89eW98zJb yykCZQaXJfDGEt6Yk0Sa8EjLvZZpNzcF9pC6udjHhZzuYo+J9bCUxx1IBt80HU16CEZd RT/dlVD4Qxqm8rGpD7VgNdT7VGaPZ944+5PARmam/o++8J1XRGfWu3d7wyjeT70rVqEp YnMfuXz8h70nIUl7XKefPwEkPiC9WAmDUodfFjdACzF+R+YlYykhuoSDcigxiTzGSwVE OVCFPWM8g23MxA10IMWOcEgBZ5JJq3NbdnTDqKreNnxprhDTy4B/7O66l7hJB2hh84En c1ZQ== 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 g126si13757379oif.106.2020.01.17.15.24.23; Fri, 17 Jan 2020 15:24:35 -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 S1730393AbgAQXXO (ORCPT + 99 others); Fri, 17 Jan 2020 18:23:14 -0500 Received: from mga06.intel.com ([134.134.136.31]:9953 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730373AbgAQXXN (ORCPT ); Fri, 17 Jan 2020 18:23:13 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 15:23:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,332,1574150400"; d="scan'208";a="306388189" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga001.jf.intel.com with ESMTP; 17 Jan 2020 15:23:11 -0800 From: Wei Yang To: akpm@linux-foundation.org, dan.j.williams@intel.com, aneesh.kumar@linux.ibm.com, kirill@shutemov.name, yang.shi@linux.alibaba.com, richardw.yang@linux.intel.com, thellstrom@vmware.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/5] mm/mremap: start addresses are properly aligned Date: Sat, 18 Jan 2020 07:22:54 +0800 Message-Id: <20200117232254.2792-6-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200117232254.2792-1-richardw.yang@linux.intel.com> References: <20200117232254.2792-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 37335a10779d..5d7597fb3023 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