Message ID | 20240125193227.444072-9-david@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-39189-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp209461dyb; Thu, 25 Jan 2024 11:34:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IF971Dxk+M6x0MJ1P/5yo/R2/U4lm/zoIwRkIC0khO5G4rF4/nYZuYxCYOjOkAFhz8qiaUf X-Received: by 2002:a05:622a:10a:b0:42a:32df:e98e with SMTP id u10-20020a05622a010a00b0042a32dfe98emr68927qtw.18.1706211295917; Thu, 25 Jan 2024 11:34:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706211295; cv=pass; d=google.com; s=arc-20160816; b=gnmMiqiBdJKZwSk2QgpRrWV0pTKMwW3npmdaeoVTXq+OeekRvVLmwRDtuo/u8m8ONJ In0OlJcHLu0YT/uvu7o0Nef8nEj4soZv37pT99McdzsXnCW72+WUuI6H3AB2c8bjecEV 3PmpunqUP/F/0vzBE3ZmUD04PghguJuHB3nIiltyRaNb/ft8V3FlAujmfa9jxeGn5GOT SU0OUMCnBOH0SvWGMjkjUwDK4DOJPosZNA1abbXgUOF7O6kio9HV0SwZT/rLmoVpExco 93OCuy+CyF0WsNKEDJ/7wUwXBFS/RdTgTpxGYJmA037CYgRf2pIliviw7yiRWMs60ZnS on8A== 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=+md2pmrHp48BftcWE7oPMr3+y6qzWNOJ1IOyjx24C4k=; fh=lZsZCQsH4ia1jFJuQK1Gi3cXLvdnrj+ub8bSs7lwlcw=; b=IMkG0V4PnaTbdiCVH3Lwo8e1Uv2KeSgIw+6TA7EwF4mBxm0RVcku3IwXK8WlhGruSK yvfI8ar9EdesbB5VGLXsTekdJfA73AZ83UaWrvFkt8+Br1IOwu/Dqy7oNa4JKVAWPeeO OSO7IsBS10EHqwj6VgcbVo6AGXc8m2WHKRmxeGMuE4y1J0mVDVJ1ZdwavGx/2VJ0rPlF irzku3EI2ZQHipMTTMYglPwGySZNcNSnv47MNv4MCRLfYG+HNeBJHgVvo6vxz+oCk5FJ nhO7SAg4z0RywFIwaC06Aaw2FQZRZgB5/Qw8+F0b78eGnYfyEnM44AebK0LhkbjKijpa y7Pw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GP7812R6; 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-39189-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39189-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y11-20020a05622a120b00b0042a7092de67si1068112qtx.42.2024.01.25.11.34.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 11:34:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39189-ouuuleilei=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=GP7812R6; 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-39189-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39189-ouuuleilei=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 AF3471C22E71 for <ouuuleilei@gmail.com>; Thu, 25 Jan 2024 19:34:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6C3013A251; Thu, 25 Jan 2024 19:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GP7812R6" 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 D5B8A137C2B for <linux-kernel@vger.kernel.org>; Thu, 25 Jan 2024 19:33:29 +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=1706211211; cv=none; b=hlYiHK+1En+BCCFo42wzMiJHiL72rLjfJ9cNyUCRnq3ig8ehcobIjTTjOg/cVaEsa6rPHvcf/oMm0SzTbH+AbNNNXYJzo9OHfGyFqDPTRtybec0ovbSEhi2SMamrEzepvWNJtrX6p2+VYyoXpjkNlxWzzkq5zMhnFB2V+Mkoess= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706211211; c=relaxed/simple; bh=ND89z77MFR+zvpNlTF7OTYgSP6ZPtepphjakoIxc3F0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cc54Zo/k3BuZM4a3AFBcJbN9PQ9kkP1tQeaJrmYYGCZD2tbjomWWfLLqkkGxWkgmJZY8uOpewTB4utKEYB0OQktuAvQw96N2Sz+Hw9R7M8ynQqYrtdIP+RTx7T3XEiObgo6SZspiZs0DlTtJth5GqslVEQ6CCvdOwc98Jfwnwuc= 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=GP7812R6; 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=1706211209; 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=+md2pmrHp48BftcWE7oPMr3+y6qzWNOJ1IOyjx24C4k=; b=GP7812R6iXVHic8gZ5QvnwnjlDj8CkIMp+3n6DapkaDlAsad4zGBiVtc7BfCocfEfG5OrV /mOv4Z9hPdQY7erXyXqImdrhSa/f+pjyWCPeUZ1FcLTQQulJlF55Elnu4eu0gCA7c99VGG yffcdD/VPKUCiyrZnjVhsFxHHjf7umY= 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-52-07MQqOk2OR24s5b8tCmCuA-1; Thu, 25 Jan 2024 14:33:24 -0500 X-MC-Unique: 07MQqOk2OR24s5b8tCmCuA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 658038432A2; Thu, 25 Jan 2024 19:33:22 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4DC1492BC6; Thu, 25 Jan 2024 19:33:15 +0000 (UTC) From: David Hildenbrand <david@redhat.com> To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand <david@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Matthew Wilcox <willy@infradead.org>, Ryan Roberts <ryan.roberts@arm.com>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Dinh Nguyen <dinguyen@kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>, "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Alexander Gordeev <agordeev@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, "David S. Miller" <davem@davemloft.net>, 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 v2 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes() Date: Thu, 25 Jan 2024 20:32:20 +0100 Message-ID: <20240125193227.444072-9-david@redhat.com> In-Reply-To: <20240125193227.444072-1-david@redhat.com> References: <20240125193227.444072-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789092216060032485 X-GMAIL-MSGID: 1789092216060032485 |
Series |
mm/memory: optimize fork() with PTE-mapped THP
|
|
Commit Message
David Hildenbrand
Jan. 25, 2024, 7:32 p.m. UTC
Let's provide pte_next_pfn(), independently of set_ptes(). This allows for
using the generic pte_next_pfn() version in some arch-specific set_ptes()
implementations, and prepares for reusing pte_next_pfn() in other context.
Signed-off-by: David Hildenbrand <david@redhat.com>
---
include/linux/pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Le 25/01/2024 à 20:32, David Hildenbrand a écrit : > Let's provide pte_next_pfn(), independently of set_ptes(). This allows for > using the generic pte_next_pfn() version in some arch-specific set_ptes() > implementations, and prepares for reusing pte_next_pfn() in other context. > > Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > include/linux/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index f6d0e3513948a..351cd9dc7194f 100644 > --- a/include/linux/pgtable.h > +++ b/include/linux/pgtable.h > @@ -212,7 +212,6 @@ static inline int pmd_dirty(pmd_t pmd) > #define arch_flush_lazy_mmu_mode() do {} while (0) > #endif > > -#ifndef set_ptes > > #ifndef pte_next_pfn > static inline pte_t pte_next_pfn(pte_t pte) > @@ -221,6 +220,7 @@ static inline pte_t pte_next_pfn(pte_t pte) > } > #endif > > +#ifndef set_ptes > /** > * set_ptes - Map consecutive pages to a contiguous range of addresses. > * @mm: Address space to map the pages into.
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index f6d0e3513948a..351cd9dc7194f 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -212,7 +212,6 @@ static inline int pmd_dirty(pmd_t pmd) #define arch_flush_lazy_mmu_mode() do {} while (0) #endif -#ifndef set_ptes #ifndef pte_next_pfn static inline pte_t pte_next_pfn(pte_t pte) @@ -221,6 +220,7 @@ static inline pte_t pte_next_pfn(pte_t pte) } #endif +#ifndef set_ptes /** * set_ptes - Map consecutive pages to a contiguous range of addresses. * @mm: Address space to map the pages into.