From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1C94145B0C for ; Thu, 2 Jan 2025 16:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735836846; cv=none; b=ahQ4qjjtLDfYEVp9ZLfP5bybdEhhtse6L+4Y5deK++Ryw91HSZQ0yWaPEs/EbVQiY/xuMlkrXUHLIsQZhco4D3lSCgtrtk1eotxxOEgHeAS5Z5EpmCeiORck9EBvlZSIPk2oBOPt0bM3By2n60Q/2cfaJbWmkOoLJQ32OEhpGCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735836846; c=relaxed/simple; bh=vd/IpOQKCsJvDy2rDfwFRMM12pbEq1H0edo8Qn5iwBE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZZ36bY8sSu9mYQBXixi0EPyHcLK4AnBW4KkoUWSVA4QqFyV8VGjDRNK47m4yi1DLBrDTC4DIy5iaqEtezeME8jdlY2SN1rVldIk0grbAdY08bkE4t6XrIipHWclv2VlcujQ+iVatVlpHcJ1ESjl8AsVWYyPrlnZOxjKC1Lkyakk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E835A11FB; Thu, 2 Jan 2025 08:54:30 -0800 (PST) Received: from [10.57.91.208] (unknown [10.57.91.208]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3632B3F673; Thu, 2 Jan 2025 08:53:54 -0800 (PST) Message-ID: <237a3bf6-c24f-4feb-8d3d-bb3beb2fd18e@arm.com> Date: Thu, 2 Jan 2025 17:53:52 +0100 Precedence: bulk X-Mailing-List: linux-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 04/15] mm: pgtable: add statistics for P4D level page table To: Qi Zheng , peterz@infradead.org, agordeev@linux.ibm.com, palmer@dabbelt.com, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, arnd@arndb.de, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, dave.hansen@linux.intel.com, rppt@kernel.org, ryan.roberts@arm.com Cc: linux-mm@kvack.org, 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, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org References: <2fa644e37ab917292f5c342e40fa805aa91afbbd.1735549103.git.zhengqi.arch@bytedance.com> Content-Language: en-GB From: Kevin Brodsky In-Reply-To: <2fa644e37ab917292f5c342e40fa805aa91afbbd.1735549103.git.zhengqi.arch@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 30/12/2024 10:07, Qi Zheng wrote: > diff --git a/arch/riscv/include/asm/pgalloc.h b/arch/riscv/include/asm/pgalloc.h > index 551d614d3369c..3466fbe2e508d 100644 > --- a/arch/riscv/include/asm/pgalloc.h > +++ b/arch/riscv/include/asm/pgalloc.h > @@ -108,8 +108,12 @@ static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, > static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d, > unsigned long addr) > { > - if (pgtable_l5_enabled) > + if (pgtable_l5_enabled) { > + struct ptdesc *ptdesc = virt_to_ptdesc(p4d); > + > + pagetable_p4d_dtor(ptdesc); > riscv_tlb_remove_ptdesc(tlb, virt_to_ptdesc(p4d)); Nit: could use the new ptdesc variable here instead of calling virt_to_ptdesc(). - Kevin