Message ID | 20240129124649.189745-9-david@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-42722-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp542923dyb; Mon, 29 Jan 2024 04:52:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2SYmvT3BHAEPIoCB/HWUObsI/LkNsWsiXU6EZU5CT838Zmsjg2FNVwKd5FhsnronyrARR X-Received: by 2002:a17:902:7607:b0:1d3:eea7:9268 with SMTP id k7-20020a170902760700b001d3eea79268mr2721020pll.97.1706532756569; Mon, 29 Jan 2024 04:52:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706532756; cv=pass; d=google.com; s=arc-20160816; b=pOSLDdpXR9loTV2jtgT6bJnjaqfAhB4cFpGR6Vit2ZhL0i8or7HCc2IxMfNFTnq5g2 AZ9asu1BDNSx2el9aT37GhRUccSK1U25cWMXVbcrwpGSUF9xuGDhUyGgJhnaNtcCBTDL 8co59/0JcHqWMVNvcU7COMrp62iISPbP8MkkGMcS3OjxBk3SahQYu5/GdG2LA4dZnaG3 ZpZOeXJf0rc7hrRMiQeuYhpu7J50mHaaS9wDgZU9egBATmsJ2Z7ri3et2Pk/fqEuxizI oOPZhXBkWdLxyik/0K0aKabfCp9Ct02bqiCCkPgheALtTqlcjhKy8ctebNja+LNTXT/X oYUw== 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=dXK02yTQR3iX9+2hOAsyvxeT8orGle3067Vuz1QJ0iE=; fh=lZsZCQsH4ia1jFJuQK1Gi3cXLvdnrj+ub8bSs7lwlcw=; b=NmDitkGiWoyxlBZtBvU96FTTAQdvernIwe7uUUyasOrEAvqfJq05auDv+KCMotwcSU +HMM5SNSucy3gDrKo0TU4ZvnE9vp2um5YqKHXfcLCJwn/Kb4gPRX//Q9seMV+Yt3O0cn nRaYWipmiX9fRNIdjSDcf9hgqZahKutmV2AdQWFvykd/rRNI7WrFIw02LaULEHe/pQD0 OEnrIK5MydvgVk54e5zRyZ6gnUjU9BHmBsZh2dSM0HxUMMfcX/fJId21R/pwCel/oy71 +v/D0PyGhzL4cJ96XtHGijn+hXmSGCvEZ1JSc6eoAjV6SifoKWOFUg8SbUG533uejfOC 0eww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=buX1YKBb; 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-42722-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42722-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jf3-20020a170903268300b001d8d72e26dasi2001106plb.548.2024.01.29.04.52.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 04:52:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42722-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=buX1YKBb; 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-42722-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42722-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6D7DC285275 for <ouuuleilei@gmail.com>; Mon, 29 Jan 2024 12:52:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D183679ED; Mon, 29 Jan 2024 12:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="buX1YKBb" 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 4664F64CCA for <linux-kernel@vger.kernel.org>; Mon, 29 Jan 2024 12:47:50 +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=1706532472; cv=none; b=RAhHIeQC7eAOD5h3c3pT7nhJcZCDqR0Ua+Yt38/EFV6IqdEusCvRh63yFE4Y7OpSfaVOwTB1bi7TPFgP4/KE0ELCpnuw6HMvFSD6ODCO2Le1xXPE3L8PbhOPt/BPIuXmmYBqSAo3321N3tvhkHMt5vU+qZmSn6wXCB9z9o+EkZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706532472; c=relaxed/simple; bh=NAbv74JbKmrqdh93Ibq9r1hHLRt7cxZLtU35wjHXMGI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FRbrZztvvvLfH81RSjqTiUc+tosSBwFiqDm5a1fCyuPBDt2YE0gIL0fnVZu54i2TEN5LvDPDtI44epwBdD7RsD4c9OyeiT3aqbqxbhN+kZSfdZGpsBBEavt+Z9cDMbuQHFqgnfd5yOFa+hs9FJGD9qgn9fyi3uwqRJF5ww8A1GI= 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=buX1YKBb; 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=1706532470; 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=dXK02yTQR3iX9+2hOAsyvxeT8orGle3067Vuz1QJ0iE=; b=buX1YKBbCsioGm/KjK94h95ReJl75nIjKEJbJoS1FEuAFXRO2wy4poXWGMfc06K24Nwnkj yi1YiUSW29kWwqj4HDZB185GErAmv3sU1n45+kYKx8nVeqj2zG8xuKDSia3ch1qszNscrY LsC5FZmB5Um3EOqhK2clsmrTX/VkV5w= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-Yd-jPcF4M0WLV77ep4J5DA-1; Mon, 29 Jan 2024 07:47:46 -0500 X-MC-Unique: Yd-jPcF4M0WLV77ep4J5DA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 C956E3CBD507; Mon, 29 Jan 2024 12:47:44 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.194.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58D62111E8; Mon, 29 Jan 2024 12:47:39 +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 v3 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes() Date: Mon, 29 Jan 2024 13:46:42 +0100 Message-ID: <20240129124649.189745-9-david@redhat.com> In-Reply-To: <20240129124649.189745-1-david@redhat.com> References: <20240129124649.189745-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.5 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789429291805407053 X-GMAIL-MSGID: 1789429291805407053 |
Series |
mm/memory: optimize fork() with PTE-mapped THP
|
|
Commit Message
David Hildenbrand
Jan. 29, 2024, 12:46 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. Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: David Hildenbrand <david@redhat.com> --- include/linux/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jan 29, 2024 at 01:46:42PM +0100, David Hildenbrand wrote: > 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. > > Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org> > --- > 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 f6d0e3513948..351cd9dc7194 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. > -- > 2.43.0 > >
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index f6d0e3513948..351cd9dc7194 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.