Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp387178rdb; Tue, 23 Jan 2024 02:54:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVRHlc9eEYWEHqenxoWdwzjtbw/d+qSmKuGSlhGiIZI1Tw1fR1yppR9TFqk+QhoVFnrp8k X-Received: by 2002:a05:6a00:8d2:b0:6d9:ac04:ceea with SMTP id s18-20020a056a0008d200b006d9ac04ceeamr2803543pfu.64.1706007258955; Tue, 23 Jan 2024 02:54:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706007258; cv=pass; d=google.com; s=arc-20160816; b=jHjJyasZl2RO2RGCdnVAuoqkIRerzErD+WP+FQSyXG7kIrlltrYPg0BgLxoe0Ry25N C3eoSKFck1wKLA8FzIzM8H7l0hDNiOuUAfWJtpakYIWNjaFsVmw7DyV9lwOxNl951iNl dm2VpvmiXEk94SmR216K95xb1ResLs7u7ziR7tFmZGjQIwChjfTH4QqjfRyCVVxeaXHo 8i7AaXvM5oP/JhVwScpFJZA1wIGtPoDAfCqaWcQnp+gjsx1vj4x6FXRJCECphRpkM/5K iRVS6+YbsPrBl04DmfsWt47b5T9IWLU+ku5TLNN572TjdRqKiP76u06deSIU4mZE8ji4 WNtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=SDbKa442BrMUXaKKpRBpBqNXVyGD9j9J4C/PfQIyatg=; fh=cLjkAanmB8aobrGIK/HTftjty0FQAaQ+aRvIv8PHcYU=; b=Ywh+aRFMz3OyNSxOKNSPp8nDpcJSt8J3upYHVyDqclHQD+RxdSb6QF+9E6jqzoyojO Dvd9Luz0b5XJGS1I3n/xKipuC3n5DR0O/ntcdjqsTODy48PN7jNsIMzRlYizK4lD9B7X EpJyK6zDhfxP2xoYIEGkr7GWlP7Lh2zNc0Uxq7PY+3Mobdd8d39H7/0TpnSUS0/wuLGZ rxqeurLsxlPNTHBSqOudvz1cEringkBmvFOJUOjrvgfc1zyfStiXUw/kOtSvbX3OuT8H sOdpfOBJ33ccnPgPPw03Ltt9/8cV0Pr1WDICji/BXHEmE8ZfqjnmEQuDOaCn/GTDXDfF bUWg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-35125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p16-20020a056a000b5000b006dbe7362a02si2467665pfo.236.2024.01.23.02.54.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:54:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-35125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 21E9FB23543 for ; Tue, 23 Jan 2024 10:48:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 899925D734; Tue, 23 Jan 2024 10:47:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CDA55C8F3; Tue, 23 Jan 2024 10:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706006865; cv=none; b=kkhKIPT+1dJZ4hb055kXbGJMwIWzb4EKVWtloGmuaq2Sx6YkjTWVRp+nNzhMLpd8KgTf+TAG1ZGsNkewTm5NqEcFPHDtWiH8ZpMP4NIYX0s1FUz6XkdyS4kqlIuRQjcH+UZvQAEKiZzBPvsIrSTUpr2rudhJecnfJ1f/6koLCkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706006865; c=relaxed/simple; bh=XdCg3Fl5iCQH7oD4ZD7hlyaOXUB+y8vwYJ2Nw8dx7B4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DAQ8uI+WHY4t0b7Hm64oqnWBXn759xXkYKnYbj2fkpo8ZfJFxYbYioNtuBkE9zyjYZZtnFmTjXhhtwKNU7TFAijQkgI4y/AR/aSacKl3f6WJOQlalI1fRJEJ7iCgKYcPVkq+NbZdkhSPv59Zu5TdsfZBDDmXxDjFzNFIwK3omA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A3EA1FB; Tue, 23 Jan 2024 02:48:28 -0800 (PST) Received: from [10.57.77.165] (unknown [10.57.77.165]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F16A33F5A1; Tue, 23 Jan 2024 02:47:37 -0800 (PST) Message-ID: <26286ea5-2781-4e70-b52b-f8a44a1b1407@arm.com> Date: Tue, 23 Jan 2024 10:47:36 +0000 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 v1 08/11] mm/memory: pass PTE to copy_present_pte() Content-Language: en-GB To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Russell King , Catalin Marinas , Will Deacon , Dinh Nguyen , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , "David S. Miller" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org References: <20240122194200.381241-1-david@redhat.com> <20240122194200.381241-9-david@redhat.com> From: Ryan Roberts In-Reply-To: <20240122194200.381241-9-david@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/01/2024 19:41, David Hildenbrand wrote: > We already read it, let's just forward it. > > This patch is based on work by Ryan Roberts. > > Signed-off-by: David Hildenbrand Reviewed-by: Ryan Roberts > --- > mm/memory.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/mm/memory.c b/mm/memory.c > index 2aa2051ee51d3..185b4aff13d62 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -959,10 +959,9 @@ static inline void __copy_present_pte(struct vm_area_struct *dst_vma, > */ > static inline int > copy_present_pte(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, > - pte_t *dst_pte, pte_t *src_pte, unsigned long addr, int *rss, > - struct folio **prealloc) > + pte_t *dst_pte, pte_t *src_pte, pte_t pte, unsigned long addr, > + int *rss, struct folio **prealloc) > { > - pte_t pte = ptep_get(src_pte); > struct page *page; > struct folio *folio; > > @@ -1104,7 +1103,7 @@ copy_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma, > } > /* copy_present_pte() will clear `*prealloc' if consumed */ > ret = copy_present_pte(dst_vma, src_vma, dst_pte, src_pte, > - addr, rss, &prealloc); > + ptent, addr, rss, &prealloc); > /* > * If we need a pre-allocated page for this pte, drop the > * locks, allocate, and try again.