Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp994234ybl; Tue, 28 Jan 2020 16:28:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwJgx7HnXIhMTpeCFj+PY8uxWSbu/+Xsd3eG0AboURajbgZWBoNyb2TvvfECQNZHMEir54v X-Received: by 2002:a05:6808:4cc:: with SMTP id a12mr4842034oie.115.1580257698621; Tue, 28 Jan 2020 16:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580257698; cv=none; d=google.com; s=arc-20160816; b=Pk4ZofQPoUtzVwZuIUp3fttjED+yzGAXBnVUedGzkxnKuysCX4t/Or3f71IxnUk0K/ 4oFrHFyr3qBchXjcHqQ3UOTp5oASIW1eljqGBYoW3kpQ1+oi+Jn9rl055dQSVRsnfgdJ 9lKEPsbBPy3pxiY9ecX6R2wIrbKDdsT/aLcdRME/cY40++U2DgLeV+we5tfT2C9YFq9z We5USsYe9WdoH/tzhZHkzmczjHPCxUo3Bkq78g9Yf1oxzPcLKDy6G4ZeZ/ZPbIbvdA8D FMSpJWm74qFZ0W9jAJHI1YIwAniDvVAmslMN2v9BYDws6lvJvU2lj9cXy5xj7pc8M2b2 S3tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Z9WNAntPqqiHp/6wvOHjQv5i8t9xJsTOAC77NAxqS5w=; b=DaY22rFJKsBwlE3ZXHgL3g8IPkYnrnqxwCLFpkbB/1tJJbzL2wGYidYLs3l18gFu92 DdI3g6/EPv7eQxH6OmYWVuv3ex5jRzkMvlKtcFd98M25b5cVzokVAryw4bXkeA4FZXtu j9BBwhnA+vMkRu36IJLQEmKa37vMusLLww0PxzcBW5kFDGms2Y7vxItJi3xL46/f9woj Z1fvLG7uYij4TDKA2ipdeOrcxDKvF8NvfkGfuVgWpIhGHNK8R3zHyiIypMleuekjNeA5 EedPCe7aOWkrZIzZiYF2xW/yyhUhwmvd4I9RgEIETvzEXgg/h/AibYwzkDHhuYfSR7St e9SA== 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 a10si215953oia.232.2020.01.28.16.28.05; Tue, 28 Jan 2020 16:28:18 -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 S1726463AbgA2A1H (ORCPT + 99 others); Tue, 28 Jan 2020 19:27:07 -0500 Received: from mga07.intel.com ([134.134.136.100]:18597 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbgA2A1H (ORCPT ); Tue, 28 Jan 2020 19:27:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 16:27:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,375,1574150400"; d="scan'208";a="223688949" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga008.fm.intel.com with ESMTP; 28 Jan 2020 16:27:04 -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 0/4] mm/mremap: cleanup move_page_tables() a little Date: Wed, 29 Jan 2020 08:26:38 +0800 Message-Id: <20200129002642.13508-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org move_page_tables() tries to move page table by PMD or PTE. The root reason is if it tries to move PMD, both old and new range should be PMD aligned. But current code calculate old range and new range separately. This leads to some redundant check and calculation. This cleanup tries to consolidate the range check in one place to reduce some extra range handling. v2: * remove 3rd patch which doesn't work on ARM platform. Thanks report from Dmitry Osipenko Wei Yang (4): mm/mremap: format the check in move_normal_pmd() same as move_huge_pmd() mm/mremap: it is sure to have enough space when extent meets requirement mm/mremap: calculate extent in one place mm/mremap: start addresses are properly aligned include/linux/huge_mm.h | 2 +- mm/huge_memory.c | 8 +------- mm/mremap.c | 17 ++++++----------- 3 files changed, 8 insertions(+), 19 deletions(-) -- 2.17.1