Message ID | 20240730064712.3714387-9-alexs@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9B90C3DA61 for <linux-mm@archiver.kernel.org>; Tue, 30 Jul 2024 06:44:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4499F6B009F; Tue, 30 Jul 2024 02:44:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F9F36B00A0; Tue, 30 Jul 2024 02:44:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 273CF6B00A1; Tue, 30 Jul 2024 02:44:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 064A06B009F for <linux-mm@kvack.org>; Tue, 30 Jul 2024 02:44:42 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B0D9CA195E for <linux-mm@kvack.org>; Tue, 30 Jul 2024 06:44:41 +0000 (UTC) X-FDA: 82395480762.27.34B3FCF Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf15.hostedemail.com (Postfix) with ESMTP id 7AC3FA0022 for <linux-mm@kvack.org>; Tue, 30 Jul 2024 06:44:39 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mfAajOsY; spf=pass (imf15.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722321837; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=izeF5G3Li7M8IcB8U5NTLnXsZEvGxbys+Msh3mE3tNI=; b=ksGh7NdK00dHqjMJrAa8vUZfi208FpWtRHqZHaJC6WzSceVXE1Yt88hriMilZxFyQ2cOud 61nfKJ5I6HPe/eWBSEoS9ajzNF1d90AcGlmfAi19NGygtaVpsYCUi4UE7r+tQ3SaB4LvXY DLAHZFHTSKcNiLmG/I7lG2QnG5nS9qk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mfAajOsY; spf=pass (imf15.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722321837; a=rsa-sha256; cv=none; b=yEiGj+2u/9FHWuAF7JDqzdir55AaYSpaZiy/wKFbaaEnIVc4S+0aXaR+7e7FjN6A2q9iwe 4hhlDHIbiSJmVA5DIQHkXxd2MMrjbvrp34JgDGGm08ntqmrqyivAOMjLTBnAQo2nJR0pjP DVLtMVX/6IcZZozXXV0tBpynriM60NA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3F38ACE0E51; Tue, 30 Jul 2024 06:44:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 939DCC4AF09; Tue, 30 Jul 2024 06:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722321875; bh=ccXL2chU8a/94eL1T1pI+a3Q5/w60GPmzE5TdAMCqlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mfAajOsY0bas1KjIZ7zbi0ly7eR8srfqY9/dGjSCEZBhCcX9YS6VakfWING1fsGF9 W0YCBavaz4bKXWCT+t6Yhfu/nqQvhZRU8uQ4308gV21op4ifIO73UuI1kTRWXnNtuQ s5Z/K60Rw4yOKEM2lNhxjV21z9g0mIa7otDskKJSUtzhlDHiE0nSamwvKeBMBIax9v uECArXHvXKdVLqGvan7uo4dKgcLJgys3j/9lFLYcEfUC1FUurphSmLjUuWStQ30LeH mcqLnZdVd1vSIjm4Q5ofH7j6+1Ir6OhcZ/gLzfEGTM1DHna6l6J8fJTKaOJDBS/8EQ RPhVDl0tGnBTA== From: alexs@kernel.org To: Will Deacon <will@kernel.org>, "Aneesh Kumar K . V" <aneesh.kumar@kernel.org>, Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Brian Cain <bcain@quicinc.com>, WANG Xuerui <kernel@xen0n.name>, Geert Uytterhoeven <geert@linux-m68k.org>, Jonas Bonn <jonas@southpole.se>, Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>, Stafford Horne <shorne@gmail.com>, Michael Ellerman <mpe@ellerman.id.au>, Naveen N Rao <naveen@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Albert Ou <aou@eecs.berkeley.edu>, Thomas Gleixner <tglx@linutronix.de>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>, Bibo Mao <maobibo@loongson.cn>, Baolin Wang <baolin.wang@linux.alibaba.com>, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, Qi Zheng <zhengqi.arch@bytedance.com>, Vishal Moola <vishal.moola@gmail.com>, "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>, Kemeng Shi <shikemeng@huaweicloud.com>, Lance Yang <ioworker0@gmail.com>, Peter Xu <peterx@redhat.com>, Barry Song <baohua@kernel.org>, linux-s390@vger.kernel.org Cc: Guo Ren <guoren@kernel.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, Palmer Dabbelt <palmer@dabbelt.com>, Mike Rapoport <rppt@kernel.org>, Oscar Salvador <osalvador@suse.de>, Alexandre Ghiti <alexghiti@rivosinc.com>, Jisheng Zhang <jszhang@kernel.org>, Samuel Holland <samuel.holland@sifive.com>, Anup Patel <anup@brainfault.org>, Josh Poimboeuf <jpoimboe@kernel.org>, Breno Leitao <leitao@debian.org>, Alexander Gordeev <agordeev@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Hugh Dickins <hughd@google.com>, David Hildenbrand <david@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, Matthew Wilcox <willy@infradead.org>, Alex Shi <alexs@kernel.org>, Andrew Morton <akpm@linux-foundation.org> Subject: [RFC PATCH 08/18] mm/memory: use ptdesc in __pte_alloc Date: Tue, 30 Jul 2024 14:47:02 +0800 Message-ID: <20240730064712.3714387-9-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240730064712.3714387-1-alexs@kernel.org> References: <20240730064712.3714387-1-alexs@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: 339ase1nhgumnrwa7689uraj69xx5yee X-Rspam-User: X-Rspamd-Queue-Id: 7AC3FA0022 X-Rspamd-Server: rspam02 X-HE-Tag: 1722321879-639499 X-HE-Meta: U2FsdGVkX19yyY82R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LtvqyXta211JYbBNgjz5wP1cuRpqcpN7fb6ron9KmpptFsBjaiB944sZOQJo0Jg1Iq8c5e1I/jJUP1junM28GR9VvRU5uYfF58Z9H93N4xTQkeF85LPr1nrhoF1EF92quMuWbiVvvYffSYsNX3cTV774X4NEZFTQnDf6l99II+v3/mcaJC1xPgHxW3xXihCIAaP8r+mWuz4FfFOhQFmSvbwjOdQh5L7WdYV62WTbzsm7OcZ89qKaqV87MO6DUqkuo9ueo2jhT0iI7PorClKNdZntnq/3BhQeYJWy96u9OCybFzwBztnad3eqn9GyTTajkqSpnkGl9Wa8Rg/WcPUJFtqKMohq0UL7gqtndxZS/n2LA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
use struct ptdesc to replace pgtable_t
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index b9f5cc0db3eb..5b01d94a0b5f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -445,13 +445,13 @@ void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte) int __pte_alloc(struct mm_struct *mm, pmd_t *pmd) { - pgtable_t new = pte_alloc_one(mm); - if (!new) + struct ptdesc *ptdesc = page_ptdesc(pte_alloc_one(mm)); + if (!ptdesc) return -ENOMEM; - pmd_install(mm, pmd, &new); - if (new) - pte_free(mm, new); + pmd_install(mm, pmd, (pgtable_t *)&ptdesc); + if (ptdesc) + pte_free(mm, ptdesc_page(ptdesc)); return 0; }