Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp56277rdb; Mon, 22 Jan 2024 11:46:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjKQSdOSa26x5URsedBPWLFgbwBeNQDFRvFJ8A/0eb9HhWpKxUld84S463AQyquZc8WOny X-Received: by 2002:a05:620a:1d82:b0:783:3cef:c885 with SMTP id pj2-20020a05620a1d8200b007833cefc885mr8627874qkn.57.1705952773822; Mon, 22 Jan 2024 11:46:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705952773; cv=pass; d=google.com; s=arc-20160816; b=w2i8UZS+gF/yxaNow04id0Ng934ZWG682R3auxuyo1koGR2o04YT6adrvcb08iQIR7 CoSX/ewm4yqFBAVz1xaeL3YfhIcPFXFVshtGCeeh1KvLYx8KhtfjnGId+J5PFHAlKISB XETnQNuxzwX/9VnUunjpIpkF8sjaX0WlZZEViy+74UClTogIcDJY6jBdIgsSIUS+hulY xpzqnjXOebQ3yhscPjZj9T4FiIOF12L/HAvjrYSa2zbTbuUU6PrFHyINLesTAnmEtzN6 NURdIihcySajbfvLa2rrz2PBPJfFObn5caVk5GaZYsP1p4H2mynEJnCuUNgg4yztWoMO iIOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uF2bxfDUAnNambtI6tdyCXd/UbNqDVLKUcWAFsWTSNU=; fh=lZsZCQsH4ia1jFJuQK1Gi3cXLvdnrj+ub8bSs7lwlcw=; b=YDcyFlUdYR9GMLYo52TFUAf5/L9SIz8zZ1kyia2mXXxt5/oXweCzijAewcAFQgVYLq z4tN9/PWhtGmYk5iCaRH6BhrwC/vsg0ddFAQ025hU5ByJZVhLr1Dm1ZwsnaTvzrAIZx6 yhinLOI1FdYBocKChwD6rqbzu9BrW0nDVzyEcFJ9Otx0EWO1ZKkyKc8eDTO6EB9HhSLI IuIWl0NRshzrMI1UQK3UnBkYi28yN0R+fOH07P690oi9fh54h+wGzsP1nL48vpMC1JZO SuefN9WwqOpr18/EsBJxyodqGr7Q8UfC6J4S8zVyMLYwx+VseomHP0Rd7u7/0+2+c7ur /LPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RqP8hPPx; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-34077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34077-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bp34-20020a05620a45a200b007839c9e3772si3582985qkb.59.2024.01.22.11.46.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 11:46:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34077-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=@redhat.com header.s=mimecast20190719 header.b=RqP8hPPx; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-34077-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34077-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 DE7271C2A312 for ; Mon, 22 Jan 2024 19:45:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16C35405EC; Mon, 22 Jan 2024 19:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RqP8hPPx" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E802347F6F for ; Mon, 22 Jan 2024 19:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705952580; cv=none; b=BuId6NBClmt0Lk3iTaHgsLqpQvCOyoXB2G0UotvNLjDeATekWv5flozbA0sKl/M62yZmZZYmP2uI2Gg9heKxVlt9amK6r1UxH6jovNK6dJ5M6Dy/hcP5AD9VhOxUsozgJcEgPipvaLD0j4uJM1ag41w44zBLgE0RAUBEbtpofGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705952580; c=relaxed/simple; bh=LQmfaE+WNxEEYA7FcHTQ60ETgLPMV6IALlAB3ldJuis=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l4zMe4FXFedADZq0aeZVDINXUeBLx8Y/zRhwPkcHdSKJIu5t/O2iz7xbxU8bN/plIy2LVKVueuUDnvASsyWzKMgA82erKpSXuaRLrF3aFBpVDzGj3+HjgFSUZOjcmCzKLnG5JZqauAmdqXNdnQBOL1zr0httmrOmrFwCDPpoD8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RqP8hPPx; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705952577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uF2bxfDUAnNambtI6tdyCXd/UbNqDVLKUcWAFsWTSNU=; b=RqP8hPPxADcx81XvKn8rfZcYa7ji+GoiuvlQGf8k1gtFxjK1DifjzStmCKEKwuSvgzmWZ5 ZVtdIMFI3zg2kXyU49MBZojeyZMDTu9BgFr4zAMHs1k+d65eL0Jv2/X2MhRiyQ+Ts27jvj m9j6SwHY0zi2NBKjBcY7m5FZpzCbRm0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-81vkS9EYMCG6II-n3hayug-1; Mon, 22 Jan 2024 14:42:53 -0500 X-MC-Unique: 81vkS9EYMCG6II-n3hayug-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 055AF106D1A6; Mon, 22 Jan 2024 19:42:52 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D396488; Mon, 22 Jan 2024 19:42:47 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Matthew Wilcox , Ryan Roberts , 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 Subject: [PATCH v1 08/11] mm/memory: pass PTE to copy_present_pte() Date: Mon, 22 Jan 2024 20:41:57 +0100 Message-ID: <20240122194200.381241-9-david@redhat.com> In-Reply-To: <20240122194200.381241-1-david@redhat.com> References: <20240122194200.381241-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 We already read it, let's just forward it. This patch is based on work by Ryan Roberts. Signed-off-by: David Hildenbrand --- 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. -- 2.43.0