Message ID | 20240129124649.189745-11-david@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-42724-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp543032dyb; Mon, 29 Jan 2024 04:52:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXT/NoNd4ZrxVEN514Kia0rLnKXcLATDYNWTvykwHeL4qXBAL34D4yQIjae7EGYUnYvZLL X-Received: by 2002:ad4:5bce:0:b0:681:1481:e2c4 with SMTP id t14-20020ad45bce000000b006811481e2c4mr5864440qvt.93.1706532772474; Mon, 29 Jan 2024 04:52:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706532772; cv=pass; d=google.com; s=arc-20160816; b=DkAcCeKBJg+tvpbFlgpir5EDK1kcYZROpQHeuL1tNLosl94wqCWa/VH58VzWANZdwK QgowgiYRbVUdiPj8GQaj1aKrmy9ItYYkPA+UdAnpzVIzi3zuoqXlLZhKK2xByyj7TPyC WxAh8F7XOfxJ54514sUHV8AswrQ7fE3GQa7a4ogRs41tXs93sQNt17s/WrQXJMpH+5+y xOBZLNETXK8KX9/HvNl7RaNp0rkgx57Gf854p/j3NqEa4GMfQMxg8V7WJMqhp6fH69aj rnhJNgqptKJF6PQjMKHIaOBTkQ5LW8kaG6VQ18BSKNhcXRQbB6hunMr66AAWne2f4jXy vTxw== 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=Y3Tbdl4mZ+WM96lxB3iHDtUIqesuPBdfScoz5at5AOg=; fh=lZsZCQsH4ia1jFJuQK1Gi3cXLvdnrj+ub8bSs7lwlcw=; b=yc8JGUqHxmG0rL3iVzFghiemQLr4FlcDtWu2sj3pL714nJkO4r92z45ZOeb2kE/VJU a1IrnnhpcFCvzVhXvT6DUgChlm/7YGhoj9u5LpMsmM2pByJya2BB4O82E+YnqanAod+N L9MEXXVXj42zC4Nl3X9z/lfhOY7mVC6iRwEpcepvBGd5ZCUV+pYsGKfDXWBW9WkB9hP8 zH5iANTmFH5OTNMlSl8tHt7jpI2gSWv2Bq3w+JJ722D3OQI1yWD/s26f933bvMGC6kjj dIzyEURZk8fcGkBfqT2uMYeBya7bU3UHTfr0Jr7aQUJU6qN24DRJA8woDlKJ4z2Rgz1W it0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NByIchO8; 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-42724-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42724-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 iv14-20020ad45cee000000b00681993f0261si7635705qvb.391.2024.01.29.04.52.52 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 04:52:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42724-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=NByIchO8; 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-42724-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42724-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 46F891C22DDD for <ouuuleilei@gmail.com>; Mon, 29 Jan 2024 12:52:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8ACF67A0D; Mon, 29 Jan 2024 12:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NByIchO8" 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 8DFEB679E0 for <linux-kernel@vger.kernel.org>; Mon, 29 Jan 2024 12:48:02 +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=1706532484; cv=none; b=H/nPzHbDoL29isbVY0nGHNMwT33/73xxocqNywbG3vMP9c5HlVQA/6tb2018yQA9Q3bQU5w4APw4DpOkxlXk95AcgizWKViWMt2xQiv0+ot9L3AjGIwYCLZ4L7qYVeO05tV6TYDAtdglc/tbFMq+V/arQvQQsEJs7+LhQaP8tuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706532484; c=relaxed/simple; bh=lsGdSPP9yjmN8xBq+o4rxdKZkBy0rfcqymp4kG2/GB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dsxz3S8YEtA3e+Jg4jWTBSyDczBcaUJp0HSWXkkYStFjzkM6d6Yaqd/QpNH0MPH0Lht1aBZJAF0CeyuyX07t2gEfdsKZuB/o83L4TQZLJh8TlhLwVkN2YDe+FbEQbVIevEc8CTKZRz/lUxaTl4EJ15M5nDv/4ZfGoZ+nhgkpvBw= 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=NByIchO8; 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=1706532481; 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=Y3Tbdl4mZ+WM96lxB3iHDtUIqesuPBdfScoz5at5AOg=; b=NByIchO8KE5MLtJDmZfH8OGs8LhDuR5XlJfDrE+D+ZFF7kvZjZg3oGzpFYv8JkhaYoDr0K 35qCMawuqCqv/98fmQ7lS/x2hcnYcRhOwCZBrrodxUL3Iqfj2IZG5Eqrdp29pTn1gg8ySC 9ahUEBPIg2NjP1z0Cy9vOtKDoL1JuE8= 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-380--x5t9X58Pm--BZadaKlp-Q-1; Mon, 29 Jan 2024 07:47:58 -0500 X-MC-Unique: -x5t9X58Pm--BZadaKlp-Q-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 C50FF85A58A; Mon, 29 Jan 2024 12:47:56 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.194.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9ED7E8B; Mon, 29 Jan 2024 12:47:51 +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 10/15] powerpc/mm: use pte_next_pfn() in set_ptes() Date: Mon, 29 Jan 2024 13:46:44 +0100 Message-ID: <20240129124649.189745-11-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: 1789429308400821519 X-GMAIL-MSGID: 1789429308400821519 |
Series |
mm/memory: optimize fork() with PTE-mapped THP
|
|
Commit Message
David Hildenbrand
Jan. 29, 2024, 12:46 p.m. UTC
Let's use our handy new helper. Note that the implementation is slightly different, but shouldn't really make a difference in practice. Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: David Hildenbrand <david@redhat.com> --- arch/powerpc/mm/pgtable.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Comments
On Mon, Jan 29, 2024 at 01:46:44PM +0100, David Hildenbrand wrote: > Let's use our handy new helper. Note that the implementation is slightly > different, but shouldn't really make a difference in practice. > > Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org> > --- > arch/powerpc/mm/pgtable.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c > index a04ae4449a02..549a440ed7f6 100644 > --- a/arch/powerpc/mm/pgtable.c > +++ b/arch/powerpc/mm/pgtable.c > @@ -220,10 +220,7 @@ void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, > break; > ptep++; > addr += PAGE_SIZE; > - /* > - * increment the pfn. > - */ > - pte = pfn_pte(pte_pfn(pte) + 1, pte_pgprot((pte))); > + pte = pte_next_pfn(pte); > } > } > > -- > 2.43.0 > >
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index a04ae4449a02..549a440ed7f6 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -220,10 +220,7 @@ void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, break; ptep++; addr += PAGE_SIZE; - /* - * increment the pfn. - */ - pte = pfn_pte(pte_pfn(pte) + 1, pte_pgprot((pte))); + pte = pte_next_pfn(pte); } }