Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp993149ybl; Sat, 18 Jan 2020 16:10:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyytXB14qt2wWgZmKLl2yeBSIINIR+yMACDBg2sgUQQydfcxbTWu5gZ8sqtGXhcHVb972N8 X-Received: by 2002:a9d:6557:: with SMTP id q23mr10762391otl.368.1579392648368; Sat, 18 Jan 2020 16:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579392648; cv=none; d=google.com; s=arc-20160816; b=b5SrCtSBJEmUzsi4Cc6TwCvThMqzsZ64c9pop07v8+eskkBPcH+EhgRG+014pNh2V3 lUg2pN9gv9+UqtKsRhHjTgswhwghI/5eEKGAW6SF1809vUdjffDWT0K9bDxz4xYMBgk7 HH1EY9NUzBcV9bH8tjueDo/fLtwbhu37fJP5QYyb/gLaZDLOTgjavp6kxw+9wOG/JhJ8 fvl1Btf7flwC+b1goo33SrLg7Mvd43n5CRMjeWsJ1xJuMjpXjjJh1cKx5YTvjGRBDRUv Xo+G+EVMyGwH6bWAMbYTdysQNGrc/sXMQ0JJvgZuaxAY41cZ/jsNFxAyVAHJmVVS1Eti vzgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uRAM88eu2QL7xuNwc4XRwD8Ues+auiEmMVAzLsEp/k4=; b=cTUucL+ufRW5x/xr2Fa3oP9y1Rdm/Q3QPG3oryeqsmqCZ5pQahw1zRytirfOB2D+9a pApDj0eQzakixbmh4rViNdnnY9xqjkSOIqYDjK0k3GypJ3o+ggPTYWDJturAi5I6zXrh /DJeIufnkhn2YqoQzLd9RXEfEJBcOf3mRMYyC1X7IiYrUEMYcmULAyQb9AoB9EXCKceC BNMwJfqsYHH5XLx5gRvV9likdfLjOdLzf8JFE8vmZcJN6yvFhix3mQavBgNywx9MvWKA //EEKoU7i9bkX0FymB8NbrFgWQH3WEag+iyu7irAtNrf6DB1PMd8RyqtQx1gL5yauJYc yafA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=USnbHbj2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x142si15893077oia.220.2020.01.18.16.10.04; Sat, 18 Jan 2020 16:10:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=USnbHbj2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgASAHF (ORCPT + 99 others); Sat, 18 Jan 2020 19:07:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:54614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgASAHF (ORCPT ); Sat, 18 Jan 2020 19:07:05 -0500 Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19248246A0; Sun, 19 Jan 2020 00:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579392424; bh=R4Rj5xaCoD2cEU5RSlC8uqyGpOVoasee2i1njuPxRzo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=USnbHbj2WKtlIKa3Q8m5QRuMgWm/DDI3Mgbe8AdM/BBF8SOpvuA3WaNVkSXu2+lv7 A6SNy2Eu6pUu5ATmAEQHCuthhYOf3QVldTIe2hjJfLrDCGKeaPptsOVoYrlYfgq9bv f/Gd5ggeVnhBoxQ73NqYfDqqCBm4UaGjWtLfrj6Y= Date: Sat, 18 Jan 2020 16:07:02 -0800 From: Andrew Morton To: Wei Yang Cc: dan.j.williams@intel.com, aneesh.kumar@linux.ibm.com, kirill@shutemov.name, yang.shi@linux.alibaba.com, thellstrom@vmware.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 0/5] mm/mremap.c: cleanup move_page_tables() a little Message-Id: <20200118160702.9e5cc9f44ef855c070036331@linux-foundation.org> In-Reply-To: <20200117232254.2792-1-richardw.yang@linux.intel.com> References: <20200117232254.2792-1-richardw.yang@linux.intel.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 18 Jan 2020 07:22:49 +0800 Wei Yang wrote: > 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. Thanks, I grabbed these, aimed at 5.7-rc1.