Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9613597ybl; Fri, 17 Jan 2020 15:24:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxCjjZzJA3oOEAFz/YiK465fd8vpCxWJdf1r039n8nTjwbl4KKbYB72KC3C7H+3v079L3dp X-Received: by 2002:a9d:75da:: with SMTP id c26mr8107114otl.40.1579303445932; Fri, 17 Jan 2020 15:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579303445; cv=none; d=google.com; s=arc-20160816; b=fOOIZG84SaEF9AkDy+JRQ+0X6i09biP/3BvYL7sTcUz/SHSygJT7K84K7HOH5dLbxc ecqsiDx/Fqn8UDj14EsHOisymnhKcNWdm7jHUn4e2YKmCzSf0M5yge0q6sNyd/RvLJIW vFCce/XgRuwh1vGa0/rTtK5shMjdbij2HK03EK9HRP7BwPUT2qLxys2q0sf7xEUoxCmU 6e3eDYiTPVJjf8FfOwlB+cr2/KdyuLhWprMn+WGyvwvyrXHIJN1fBvG45jMoHVXJTVm1 z1leham8A4rE5ix1X63sSjsiKciT/K50sQsz4GVDj9cX+TMvsJPYecoAatx4XO0avqcS gGVA== 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=1oNeMQHzrz7ymgQ+i3UQUkCy+GcwD6hpGiET0O7AfRk=; b=w6rz9VJPfnwe8wKKjDO3I9xKWvt3YVkbjw8iW0Ubl5wNZ3Gt5CwjZmoLjFE6N5Go7R oh48twaMUxqztaiCTiFQd/YCXHMaLfED7zVsZP5tablkllTK1/zA0JdDvTjkZ/8lmJ3P ZLx2uRxUNRYnlaivwPTBrAsS6kbWVW/sXkfCp2H6uTM7lvgLxrmshH3BAAq1fV7uwWWo iMVOE7dcshh1xBsQQO6b/iLR7K8rU0hqN0wCwpKcw4NL/fhvYt3rkFIhR70hJbXGIQf9 3RdP1EtkWP3OaSNwNyuG6okcYCYoJXK7et+7p9jrYcS/dc1u87JZc49hrxLhH4C0AX28 i6tQ== 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 t1si16220351otq.322.2020.01.17.15.23.54; Fri, 17 Jan 2020 15:24:05 -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 S1730260AbgAQXXC (ORCPT + 99 others); Fri, 17 Jan 2020 18:23:02 -0500 Received: from mga02.intel.com ([134.134.136.20]:65054 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729099AbgAQXXC (ORCPT ); Fri, 17 Jan 2020 18:23:02 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 15:23:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,332,1574150400"; d="scan'208";a="373800922" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga004.jf.intel.com with ESMTP; 17 Jan 2020 15:23:00 -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 0/5] mm/mremap.c: cleanup move_page_tables() a little Date: Sat, 18 Jan 2020 07:22:49 +0800 Message-Id: <20200117232254.2792-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. Wei Yang (5): 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: use pmd_addr_end to calculate next in move_page_tables() 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 | 24 +++++++----------------- 3 files changed, 9 insertions(+), 25 deletions(-) -- 2.17.1