Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1919005rdb; Tue, 20 Feb 2024 10:47:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/vGLbv0UFIWClRjOMZwge8vAQRBOIYI8agRwYVmm1uyJYW6HFRG5KzxF+JgvI3L4y6uhM12BvrGmKiLU479Bb5w2APbz3/OvRvoTYhQ== X-Google-Smtp-Source: AGHT+IFJ39wQAFZj73E00KcWYgppjkqpQ0pZrsyDvWRkaCedyyn26jZhGr6ODue5ijuutgg78tjG X-Received: by 2002:a25:a2c5:0:b0:dc7:46b7:6d67 with SMTP id c5-20020a25a2c5000000b00dc746b76d67mr13955490ybn.33.1708454864520; Tue, 20 Feb 2024 10:47:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708454864; cv=pass; d=google.com; s=arc-20160816; b=owVUt2+AgdswcUd2JcXnZIlj28kP26rK1bpXgwpvK6MmiWWujO9rkchIpM1Wo24yoZ tm8lRgoPck6cGuD3mNyK1jyAk1OOssPxUSV8KdhqHSISfLOqYR3YWW9av8YOdSysN+KA 6m2S9dk3pF3Ux2aic+VRQsTvi2T6FRaihvvGVubHcHXWwsnG2403sAtpEfPR/LFdU+Lp UKQxFg45jRfuNTfSBRZjF+OamLPvHcIJU0ahhsRXA2idSFT3/qZ9KwChDiMRgsWmQR7V xSnrdtVLlHMX2ezqS7ddbW8V/mgpuQlA8yyHuHG1IQj9jpYhU3JqFaE5mzCFtQJad0SY Jerw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-filter; bh=abmLUZA2u30RbPloCau3Hq91MWzx1vXDvtW6wZ0lEPE=; fh=kiL83lhe39Ts2nOD35Wkeakle94no58ZhcdlbUMCqL0=; b=BkhPIFA8NGF16AhuxZQ7nciYn7sRyEdp5bRC2TGpA0Yce8MUqn5WA7No+z823/gfZH G60+DN4vZDV5uQ3TZW5o8TrWe2nHzmPv559JVrlBaLm48QyrzrLO2aqrKM+ECN2/OYYU 8wTgZzEFI0Ho8mnMT4q82YQM2bTfVZ2U6AgPFG5CZYoxdAqwdUHm/Jm5QNXoiTgfhCr+ 9aJMGqjDIjg0kdGLlg4CxlYBXHXz9XvRLEOgHdPCa1cwGunkk8tFcWZG13oSRzjhfcZJ tvu6V9aDPZF6lxAllCJ/MuS0nlPapL7ELhLZd0010NMXm0wwXXRekQnqzIEPHkH1P+AK R/lw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024021201 header.b=na5wZgH5; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-73543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p2-20020a05620a112200b007877cc9802asi1375194qkk.243.2024.02.20.10.47.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 10:47:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024021201 header.b=na5wZgH5; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-73543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 485A81C226FA for ; Tue, 20 Feb 2024 18:47:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EE8B13474E; Tue, 20 Feb 2024 18:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="na5wZgH5" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C88FE12BE85 for ; Tue, 20 Feb 2024 18:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708454835; cv=none; b=PWpu0mHHwEt6yXdFqjDi/au+I1CWe0Kb3p+MUjh3eWVguNIkFTMfcG4HtZ+IYozxaP17AeUjOeNtNwCTa7R20g0ezkUGoqGW6Xeugp5r/YzwAK+cG6i+gN/66majOQO5YCXH+okG7AOlrhwFQCRRRXdI2mulysdP/ORYnHze0lM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708454835; c=relaxed/simple; bh=Un0DyfNztP+ma9po9fJZYOyUeH8Btllkk3oREAq0Mgs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qOVyc105385AXgCneM0tAoR/awpUIs8WOj0zy7qqQvTWZqFKf8LaDgSqoI+eM38AyqgGuMVPtZlUQsQ8k2IIA1WcPi/u7qY8fKSsuYtRjhxhTbH1+KCypWoSFkC40bEhtSnUUgCa6SiG9Cyy9QPq9b0ktZ+9yINWd1Vh6PvrPpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=na5wZgH5; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [192.168.7.187] ([71.202.166.45]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 41KIkc1O3731767 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 20 Feb 2024 10:46:39 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 41KIkc1O3731767 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024021201; t=1708454800; bh=abmLUZA2u30RbPloCau3Hq91MWzx1vXDvtW6wZ0lEPE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=na5wZgH5KcpLTANe9sXcc5m1+sTkRkzEtr3h7ep/PCZsn8vxVGugP8DwJn0cw7mOX BXG0fBcJsMXU/+5E1uJ0637xaaNXg/vm2GGvFyJVhtc2Nc4FiQGC5rhjWf5FEyOnPC L9JzEdgOxMUu78S8j/OdI5D3A8z2825bdRFN2SGM82z7hyr3c4UveJA42ux1+ZY0d2 bc8FM4c+2MVN7TvCIcbakraLDa7EAtRPnfHglnPdLCmxq7dkPWRUC2E6jmkMal7KhZ RmP9ZWHgsmaGlvPbSQNJTFpvJNcDudSQjQ77G/Ubw6Aslw4s5fXxoqZWTbfUU36nJU sLs22rRTNGhUw== Message-ID: <34d76192-d00b-409a-8a1b-11a6c8433d66@zytor.com> Date: Tue, 20 Feb 2024 10:46:37 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/3] Cleanup for PAT Content-Language: en-US To: mawupeng , akpm@linux-foundation.org, dave.hansen@linux.intel.com, luto@kernel.org, tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, bp@suse.de, mingo@redhat.com, rdunlap@infradead.org, bhelgaas@google.com, linux-mm@kvack.org References: <20240220034835.507022-1-mawupeng1@huawei.com> <07d43633-d707-415d-a662-ecd3a50b12ae@zytor.com> <1f98fd3a-9a2c-437e-8e86-8c5f575917df@huawei.com> From: Xin Li Autocrypt: addr=xin@zytor.com; keydata= xsDNBGUPz1cBDACS/9yOJGojBFPxFt0OfTWuMl0uSgpwk37uRrFPTTLw4BaxhlFL0bjs6q+0 2OfG34R+a0ZCuj5c9vggUMoOLdDyA7yPVAJU0OX6lqpg6z/kyQg3t4jvajG6aCgwSDx5Kzg5 Rj3AXl8k2wb0jdqRB4RvaOPFiHNGgXCs5Pkux/qr0laeFIpzMKMootGa4kfURgPhRzUaM1vy bsMsL8vpJtGUmitrSqe5dVNBH00whLtPFM7IbzKURPUOkRRiusFAsw0a1ztCgoFczq6VfAVu raTye0L/VXwZd+aGi401V2tLsAHxxckRi9p3mc0jExPc60joK+aZPy6amwSCy5kAJ/AboYtY VmKIGKx1yx8POy6m+1lZ8C0q9b8eJ8kWPAR78PgT37FQWKYS1uAroG2wLdK7FiIEpPhCD+zH wlslo2ETbdKjrLIPNehQCOWrT32k8vFNEMLP5G/mmjfNj5sEf3IOKgMTMVl9AFjsINLHcxEQ 6T8nGbX/n3msP6A36FDfdSEAEQEAAc0WWGluIExpIDx4aW5Aenl0b3IuY29tPsLBDQQTAQg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IRrdCLVQcgU4glo17vqfEaRcTW5SgX+pGs4KIPPBE5J/ABD6pBnUUAEQEAAcLA/AQYAQgA JhYhBIUq/WFSDTiOvUIqv2u9DlcdrjdRBQJlD89ZBQkFo5qAAhsMAAoJEGu9DlcdrjdR4C0L /RcjolEjoZW8VsyxWtXazQPnaRvzZ4vhmGOsCPr2BPtMlSwDzTlri8BBG1/3t/DNK4JLuwEj OAIE3fkkm+UG4Kjud6aNeraDI52DRVCSx6xff3bjmJsJJMb12mWglN6LjdF6K+PE+OTJUh2F dOhslN5C2kgl0dvUuevwMgQF3IljLmi/6APKYJHjkJpu1E6luZec/lRbetHuNFtbh3xgFIJx 2RpgVDP4xB3f8r0I+y6ua+p7fgOjDLyoFjubRGed0Be45JJQEn7A3CSb6Xu7NYobnxfkwAGZ Q81a2XtvNS7Aj6NWVoOQB5KbM4yosO5+Me1V1SkX2jlnn26JPEvbV3KRFcwV5RnDxm4OQTSk PYbAkjBbm+tuJ/Sm+5Yp5T/BnKz21FoCS8uvTiziHj2H7Cuekn6F8EYhegONm+RVg3vikOpn gao85i4HwQTK9/D1wgJIQkdwWXVMZ6q/OALaBp82vQ2U9sjTyFXgDjglgh00VRAHP7u1Rcu4 l75w1xInsg== In-Reply-To: <1f98fd3a-9a2c-437e-8e86-8c5f575917df@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/20/2024 1:06 AM, mawupeng wrote: > On 2024/2/20 16:37, Xin Li wrote: >> On 2/19/2024 7:48 PM, Wupeng Ma wrote: >> follow_phys() was introduced in commit 28b2ee20c7cba ("access_process_vm >> device memory infrastructure") in 2008 for getting a physical page address >> for a virtual address, and used in generic_access_phys(). And later it's >> used in x86 PAT code. >> >> Commit 03668a4debf4f ("mm: use generic follow_pte() in follow_phys()") made >> follow_phys() more of a wrapper of follow_pte(), and commit 96667f8a4382d >> ("mm: Close race in generic_access_phys") replaced follow_phys() with >> follow_pte() in generic_access_phys(). And the end result is that >> follow_phys() is used in x86 PAT code only. > > Thanks for the explanation. I have a better understanding of the history of > this function. > "git blame" tells the story. >> >> As follow_phys() in untrack_pfn() can be replaced with follow_pfn(), then > > Yes, this can be replaced with follow_pfn(). > >> maybe we don't have to keep follow_phys(), and just use follow_pte() in >> track_pfn_copy()? > > As follow_phys() will return unsigned long *prot which is need in track_pfn_copy(), > we need to do something with this. Commit 96667f8a4382d did that already. > Can we replace follow_pfn with follow_phys()? Sorry, I don't get your point. Thanks! Xin