From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A98C43B6C4 for ; Tue, 1 Sep 2026 16:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788278781; cv=none; b=ZmnlBUfkpuG0Q5juBWXNAvamLWgMfNUCE6x9TQOWfcxZqEr/yqthPtgu9H1e5I0anML5q1KsEKHI/BsuNdUFQ+7iMGto20JYPEr/ZbbKPoxGcs82/JFHrtSiJVfC6+O7SatTHovpiHE59c75oucpPcD0Qzp9OXq/7JK4cC08NFA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788278781; c=relaxed/simple; bh=m9GF6BVXJghb0t0TACX7Y0SpJfQTXPLs06gu6gZAn2Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jNgYRB2OQU5EPOS9+A+GghoXiUWzVzADi9Q1aNQNmH3EqBrfqEGHw9ADD0iowAWBV7c7SmqSOsMO6x231Tu//QgHOUKG0tOusY4ZpOVSCteHtdFee6uuZ+z1a2Za8yV7cHVilezPaDlnKMg+98XfEHyqQntNeJQQq/Bfm9Cy+us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=BQcWIcoV; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="BQcWIcoV" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-936cda0e3fbso8101985a.3 for ; Tue, 01 Sep 2026 09:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1788278778; x=1788883578; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=BQcWIcoV7P3Hr2LDZpO5LnlyE0+kl7BJcY/963/R3GpW+crY1co2xJ0VB/jrCBT5U+ sUWQ0qhCyeJNxHtT6geZRvpMmyBGAmAqykF3LtaV2i1XYHstPYbbJwP2CNyvATO0fX7+ qdAzbkhHzNaFhbaje/y8wVWDOoJ+O8NTGXOplwJne+lpwuLVz4/mIJkeh0+/O1qhaoSZ 0L8++LEs2lMFVe4zBAmvRmxeNtGBbF6AWtXQKKjSUg79N+3uZkVTZ45yKLBp848ccCNt HkWwtQY+zmVRVYj7zfVvYfJ9ZFsctneRdffIWTYUSyHt/PGBfVimfMFQZCKGETAmlej3 AErQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788278778; x=1788883578; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=Eauhl1OVZ7dKXnU0jKJF327lkWM6hGs4TgaeCHofoz76ZgMYBSjGbO2FPCsxJ8KdIa NFPkydaiLZgmaWjPyRmEi3r3zq67API41a1KqBfwVq4mJENuiw4eln9zDjiwM2JWJArf 1JeVIgxi8OvufnKcgfpHr85fK3ngksHQoMhj1+Qf+cpJYo8UKvt2lr2Zkh/7nMv4g0aC DE6ss+asWbgddnNbDrIom5V975yli1tKv6BbjvUpq2AfDvAY8OHDNGh8e7BntN1Avtm5 eZrr/pApQKiNrlaIkuN29isQ1y475fY4qkUwM2+wpq7Aan5fHS7v0bgham8vXa84YX8X 2wAA== X-Forwarded-Encrypted: i=1; AHgh+RpNxdxqeiVygfEl2s8UIxGFSr6BhU3tgrn2BbT/pAYFTx+U55BUUlc73y2pcaMdkTR2a5K+mkanFHoF@vger.kernel.org X-Gm-Message-State: AFuF++m2bfYz0CJv8rCvxqfrfzWDEkpeAeNcE0SWfBaJMkeY5y2bHx1z v7r/TKLKJC/SbSU/ARGG+HkAPggYfsAR+GQ7761uDYFlT9VQiZqONBzWGK3K0sSvbRM= X-Gm-Gg: AR+sD10/AnqfDLYZan0/zeOUO5yLZqiuCmYoIFzW6Nbn+uCkibW89oNJT6oK6++GLSU pbPA80q6YshJ3yqhk1jhnTuNx9zP43jhxc6jyyQ0AxSoMl50mawrsYyRE66YmVQRuvFdCWt1hUQ a9q46UnMz6sFWDNXvdSG5USeQG0Zs6Z0MCagWUjzIDf3tMbVj1hCHZAUuVDLPmxcErBmqom8rwd pBbaR4B25H/CNMKz1OALn+XMWbpd+Zx2VO4FNlQ8JPLCDM08dwPumN3gSgrkt/W0a/0e+SK4OyS lHDjc6PSGHvngeVvQLLGSX6ipcLeuqdX+ISYaRB7sfShhMyElOWOY4ntRu2SiL3qC9KH/yJ8VdZ 0SohQ2vywniN2MXeVJ2XY//seOlayYLxmo+d89aITH0TFC+tXdDsgV3KIMHyWiXASy5RwRBNgLl 1afsNfqVRNVrA2s9hBvY7Kano3RRUFA5SZMcZw6qXuO+blemfsMzRYj4nRnDv99rW16qxwJorve XR8mvEEe8bdtGPYMnqL5vCYTGn1B7iirYspxe8MOnkytA== X-Received: by 2002:a05:620a:21d2:b0:936:ea0d:ffc3 with SMTP id af79cd13be357-939139002d3mr3178331885a.22.1788278777843; Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93922e5278fsm886283685a.14.2026.09.01.09.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1x1R04-0000000BtB8-1Fgr; Tue, 01 Sep 2026 13:06:16 -0300 Date: Tue, 1 Sep 2026 13:06:16 -0300 From: Jason Gunthorpe To: "Liam R. Howlett" Cc: Kiryl Shutsemau , "Lorenzo Stoakes (ARM)" , Andrew Morton , David Hildenbrand , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Guo Ren , Brian Cain , Geert Uytterhoeven , Dinh Nguyen , Simon Schuster , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Russell King , Vineet Gupta , Michal Simek , Chris Zankel , Max Filippov , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , "David S. Miller" , Andreas Larsson , Richard Henderson , Matt Turner , Magnus Lindholm , Catalin Marinas , Mark Rutland , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , John Hubbard , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, Hugh Dickins , Qi Zheng Subject: Re: [PATCH 01/12] mm/huge_memory: zap deposited page tables after an RCU grace period Message-ID: <20260901160616.GD56830@ziepe.ca> References: <20260901-rcu-pagetable-freeing-v1-0-5456a81c8212@kernel.org> <20260901-rcu-pagetable-freeing-v1-1-5456a81c8212@kernel.org> <20260901142408.GA56830@ziepe.ca> Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Sep 01, 2026 at 11:54:47AM -0400, Liam R. Howlett wrote: > On 26/09/01 04:28PM, Kiryl Shutsemau wrote: > > On Tue, Sep 01, 2026 at 03:41:17PM +0100, Lorenzo Stoakes (ARM) wrote: > > > On Tue, Sep 01, 2026 at 11:24:08AM -0300, Jason Gunthorpe wrote: > > > > On Tue, Sep 01, 2026 at 03:12:45PM +0100, Lorenzo Stoakes (ARM) wrote: > > > > > > > > > It won't be costly at the time of the calls obviously as its deferred. Maybe > > > > > increase some time spent in softirq but again is 512x that big of a deal? > > > > > > > > > > I'm not sure how you'd both defer the free and somehow utilise mmu_gather here > > > > > either really, certainly not without it becoming extremely messy. > > > > > > > > The less costly version is to thread the page to be freed onto the > > > > mmu_gather through a linked list in the struct page memory. This is > > > > super cheap since it is just a singly linked list operation. > > > > > > > > Then when the mmu_gather is flushed it does a single call_rcu using > > > > the rcu head of the struct page of the head of the list. The callback > > > > clears the entire linked list of pages. > > If you are going through the trouble of doing this on your side with a > custom rcu callback, it might be better to pack the pointers in a way > that does not need to pointer chase through a linked list. Well, I have 8 bytes of memory in a struct page and can't allocate in these paths, so IDK there is another option.. Jason From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12CD5C624D3 for ; Tue, 1 Sep 2026 16:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j436graEr+d+oRtodxCc76E7HfUd7TgX7HXu9ngBZFw=; b=ZjuM4/HwJfzKML aBjT6qt4FlehzOxK1GJ/af5Z+W9ods+H3DM4sfyksI5UnxyW5CMQCpsBYJkbgooPPbyIbBzA9RLNA RnHtvu8vsFGDRRZRWoRJpzsTHZ+kse5oghnpMHmsE+XlyHtwSDi8h6DphNqQpLGy8mDl+UwT4eSpM UxuB9Q8ATWD0TEf1uQEMrXmZJ5VknyGmPLvk5QiF9vhLI3ll/6PRRIumwWKukVqNC6LmXM58dRecC 6EHdfP4YPk4arZ9jzTbsJH5JiFo+9IS71e9YMZR6MR1t5gWSb3RwMEIg+rGf8ilKu8Rx+BDIHxiCS is9jFo8Fl3vutubAUE0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1R0B-0000000CcPv-2RQo; Tue, 01 Sep 2026 16:06:23 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1R07-0000000CcOC-1V32 for linux-snps-arc@lists.infradead.org; Tue, 01 Sep 2026 16:06:21 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-92ea24a2dbfso10713785a.0 for ; Tue, 01 Sep 2026 09:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1788278778; x=1788883578; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=CipmyFXprLXKCdf/YdPGgd6GanNr31BHGVcJyTIslXAa+F72TrHGnme9er/cbcnkT2 +ERkBr4tOnWwbufL2WQL3Ap3iB1U0NA3WzCxui/lV2Ixcw2/GJcS+yD72yj0HZghrt+M ujNoOAe1BDD73hD7U44ipG60cvP4sp8BxxioX+3v/GmjNbcteFWromxN/IyU+wjE1WmU HLnO7lk03sn6Es03MApgQ/pqQr3PLnGmWslHkJdpGvguFQCqCY4V0LmK0k2t47zOqf/M bEx3LhsOhUhiHjvJ5dOF1adhKqBLERgvz/YdyjR2JHWdD6ppuw8Yon6exb+A4cjWJnpK YzyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788278778; x=1788883578; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=PAb9ANXcF4xstuM10aCut/RR4CaIm17CvrIRQS2SWfxFR2CrR1/OzzMkC9maUjT8oM ysO/MbOZTvX6LXytjK3PSYAjcXM3ewbX1sW+R17enDTkjmMijdqDVtgseXZk0sp9SUDi uSXmRdMfJs09VhTBKVDKjsmjlkAe1tZ1lHNBIgbSAWWSVgy7r4/cS60DbzGG1lat0JL9 0LmXfhbaF3LJcYrWwp380KWu2sRMHbtGwRceMoEcsdxmyMaGClOT2aPw+4QLcV+VCpec cX3+f2/IZBol2YiKT/jHw33xe9wS4Vx4Dg7W6N1AKtzPNpALINs6OLWV4OLuRZiIce5N OIzQ== X-Forwarded-Encrypted: i=1; AHgh+RoCLOKNwS7Wz5vdHpzlc+EMpmN0LOlxDLbUSBh5kIJ9F6jFSXhs0a9fG/5w2Bvs163fhImShIfxrDdFhJ4YaA==@lists.infradead.org X-Gm-Message-State: AFuF++k2W0edYDiilGO6+c+TNh0QmTtg+gJzAnX9OKZqvgWQCkl3WBNn oQglbwzscfUMNmlff0b1Fb1ad7z9hcFMluDSykvDzKi+liVtm6sDJq5PoP0utIHGD6E= X-Gm-Gg: AR+sD13gNnde2DLePI+6o/Asu8Bx0SXOayqwSN2Vl01AnCyeYWD/eM2jY2zODy87Mez EVFezTM8tStYIKnTeFPwO+w4qBSimK4lek3GevQBy2z574r9qLaK6m06t+XLOo76dYfY1fNgwy/ 8WlauqX6gz+1tvUIsZqXCDUSmR8i9gcnvnpWmfIh28SybftRpGCynS1pE9BnVNR9jUzaLgTtV9C P73wafxqcSB98w+8fph7kx00C4Vl3w8to7bNuzVTJIVU6gtGuOD6wzzMmtIUke4nujKXFOFYfG6 atAnRt/rg3uW+CrXqdGhpK3GVyhA0MtjLpFtqyVktVqaDzwnZGUEjKXz06+pV6xSJsU3hY1Isjj x69WBgvjBPXaaO0/iQXtV8R6M7H7QYgCgkCd8nBhC8nbsNkectZnxJEVujD/Q+EHksGS+/XKr+i sSGyzN0VgTrM+U2r5b+uhHQOVb0WPG2iBx8+jkFyWX+pfgYrTrZ3XvKO/A6veOIFhasVBtCpmte 91Iaue18GX4H4nrU6Z5ymi9aZEdZtMsyBqPaEBRMBjnug== X-Received: by 2002:a05:620a:21d2:b0:936:ea0d:ffc3 with SMTP id af79cd13be357-939139002d3mr3178331885a.22.1788278777843; Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93922e5278fsm886283685a.14.2026.09.01.09.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1x1R04-0000000BtB8-1Fgr; Tue, 01 Sep 2026 13:06:16 -0300 Date: Tue, 1 Sep 2026 13:06:16 -0300 From: Jason Gunthorpe To: "Liam R. Howlett" Cc: Kiryl Shutsemau , "Lorenzo Stoakes (ARM)" , Andrew Morton , David Hildenbrand , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Guo Ren , Brian Cain , Geert Uytterhoeven , Dinh Nguyen , Simon Schuster , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Russell King , Vineet Gupta , Michal Simek , Chris Zankel , Max Filippov , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , "David S. Miller" , Andreas Larsson , Richard Henderson , Matt Turner , Magnus Lindholm , Catalin Marinas , Mark Rutland , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , John Hubbard , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, Hugh Dickins , Qi Zheng Subject: Re: [PATCH 01/12] mm/huge_memory: zap deposited page tables after an RCU grace period Message-ID: <20260901160616.GD56830@ziepe.ca> References: <20260901-rcu-pagetable-freeing-v1-0-5456a81c8212@kernel.org> <20260901-rcu-pagetable-freeing-v1-1-5456a81c8212@kernel.org> <20260901142408.GA56830@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260901_090619_409712_AEFAB714 X-CRM114-Status: GOOD ( 23.57 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Tue, Sep 01, 2026 at 11:54:47AM -0400, Liam R. Howlett wrote: > On 26/09/01 04:28PM, Kiryl Shutsemau wrote: > > On Tue, Sep 01, 2026 at 03:41:17PM +0100, Lorenzo Stoakes (ARM) wrote: > > > On Tue, Sep 01, 2026 at 11:24:08AM -0300, Jason Gunthorpe wrote: > > > > On Tue, Sep 01, 2026 at 03:12:45PM +0100, Lorenzo Stoakes (ARM) wrote: > > > > > > > > > It won't be costly at the time of the calls obviously as its deferred. Maybe > > > > > increase some time spent in softirq but again is 512x that big of a deal? > > > > > > > > > > I'm not sure how you'd both defer the free and somehow utilise mmu_gather here > > > > > either really, certainly not without it becoming extremely messy. > > > > > > > > The less costly version is to thread the page to be freed onto the > > > > mmu_gather through a linked list in the struct page memory. This is > > > > super cheap since it is just a singly linked list operation. > > > > > > > > Then when the mmu_gather is flushed it does a single call_rcu using > > > > the rcu head of the struct page of the head of the list. The callback > > > > clears the entire linked list of pages. > > If you are going through the trouble of doing this on your side with a > custom rcu callback, it might be better to pack the pointers in a way > that does not need to pointer chase through a linked list. Well, I have 8 bytes of memory in a struct page and can't allocate in these paths, so IDK there is another option.. Jason _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAA9CC624D3 for ; Tue, 1 Sep 2026 16:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=38t0peZoylT5/XuG4Ljtq+Dh/eedg1VMbX8lYMSVR0Q=; b=FNgZJJLSKOG53U wP2G7iIeIIlm0UHveEhDOeElrfZdSS4CY46k9vu0NbxGAeZ5Mod2Jnvg7YKEDRn6df/87dH/iNMtB r2cB36h7qseerDGYpNZoASjqZxorXNKNGtugIamfperqKyzZnKfk1BQ79d7YzU9WNmbKURfiTsetu wpycuM142FZBbGq7y73Fh6YW0q4aDd9i4w4YWtb30oWzTzfeoNC4NdfCcl38QXUqfDmH0zMVThQf6 /eEXgmgMweGc9rPIiypIQWDXlQstltEJCZngSIStkp6gJJ3aNmmIppHdWlbz8F1H6v2mp/yAyJl2t q3grNmlxnpXzx7T70Www==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1R09-0000000CcPE-22lZ; Tue, 01 Sep 2026 16:06:21 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1R07-0000000CcOE-15HG for linux-riscv@lists.infradead.org; Tue, 01 Sep 2026 16:06:20 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-936cda0e3fbso8102485a.3 for ; Tue, 01 Sep 2026 09:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1788278778; x=1788883578; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=CipmyFXprLXKCdf/YdPGgd6GanNr31BHGVcJyTIslXAa+F72TrHGnme9er/cbcnkT2 +ERkBr4tOnWwbufL2WQL3Ap3iB1U0NA3WzCxui/lV2Ixcw2/GJcS+yD72yj0HZghrt+M ujNoOAe1BDD73hD7U44ipG60cvP4sp8BxxioX+3v/GmjNbcteFWromxN/IyU+wjE1WmU HLnO7lk03sn6Es03MApgQ/pqQr3PLnGmWslHkJdpGvguFQCqCY4V0LmK0k2t47zOqf/M bEx3LhsOhUhiHjvJ5dOF1adhKqBLERgvz/YdyjR2JHWdD6ppuw8Yon6exb+A4cjWJnpK YzyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788278778; x=1788883578; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; b=GBQDdX0tYA306Tduxf/sf5oA3kuty7IV44vj/VlM00ZWwEdVoTWr1J3aSoQqmBjI1s u4eKMy+tqou6BeBiVq1g/1ly4OUWE0iAjZTM8EGMVYalOOPhcfsivgrGkDaBuFbG9dER dXQGBJ9JuDTWeUorRju4me8VgxLf1/kC/0zOTsb15abILU+kzfGlPNTMi6vc0VrD1UCB 6PPtAKnwDUKg02qWrk/YbROWBog2SSeqxVPzkR8czTicktQ4l7pCriYbZrIaMXPzhQwR PdLSFsqFd6WtEuCrHeFOjay8iiOsKbnHbQ44gf9o17lE4L1lgoaqRAZur6bq0ZLxGgSV +oXw== X-Forwarded-Encrypted: i=1; AHgh+RofDPk43L+6MZdWeWBNMeMO4uAS7aMc0ueGP4yRECLcrJvmoyf8hcAoMKsLHBV14c5Rn2tCTBP6oJ/Qpg==@lists.infradead.org X-Gm-Message-State: AFuF++nAcn36nYC50aROOhYrL5LGZX/A8r8F4/iQRZFY+cRSbD3FYp44 RCOimA/zyV1owcF9o6iiMhXnqzNMc3caOKZCmutvpAW89gx2T9iTvRB7cyqkZgI0zaQ= X-Gm-Gg: AR+sD13bB+f/Q0XKKxTAPUZUL4sYGtbxK55R3hcVIyxp8a7F9MNVixZ85jAXFT72NeW H0DbTQFjFG5CpdXtQ5KQ/fSTvvhscQzUMjAKZhplM661R7LlB3RpQ6TjjjjK8qOTxvV7EVtsI7c kL2Ilr1f1IIeT4jCvyW2+hEQpAMvHEG1vZmwE49Mm2fouHJQG1RytkgfBiUaTAh1ejgDg30cC44 Stx0UjpN/XVqPpqXKbnOSPHGhjTzOHkS2i04rTRgoNpPgA8rl9x5yvNVc90zZhtCq5vZpk+P8g/ 0dycsX+udimEU+2d8BvtMGEdoQQkw0yLB3KrW+yUdcS+4ViWbep90JjkREPWcFnkTWCWezXbAdM OszddVra1RiVKozWmGE7qjO2VLtbJaWy8CFN3JJbfnk8z8hyGDcGBjlILmNB36IwtDkHJXU54XU tMw4Nedf1dJYAh8IhiH2VOGWBcHBlMRkoNuQVCYF5RSPGFF3Y9bwdndEdnN9JnIEAhLC+S3VJL4 jxz12vJ77vUi8MtfSsuS0pgW7D/CMO0ue6GTT6SuflgSA== X-Received: by 2002:a05:620a:21d2:b0:936:ea0d:ffc3 with SMTP id af79cd13be357-939139002d3mr3178331885a.22.1788278777843; Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93922e5278fsm886283685a.14.2026.09.01.09.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 09:06:17 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1x1R04-0000000BtB8-1Fgr; Tue, 01 Sep 2026 13:06:16 -0300 Date: Tue, 1 Sep 2026 13:06:16 -0300 From: Jason Gunthorpe To: "Liam R. Howlett" Cc: Kiryl Shutsemau , "Lorenzo Stoakes (ARM)" , Andrew Morton , David Hildenbrand , Zi Yan , Baolin Wang , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Guo Ren , Brian Cain , Geert Uytterhoeven , Dinh Nguyen , Simon Schuster , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Russell King , Vineet Gupta , Michal Simek , Chris Zankel , Max Filippov , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , "David S. Miller" , Andreas Larsson , Richard Henderson , Matt Turner , Magnus Lindholm , Catalin Marinas , Mark Rutland , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Madhavan Srinivasan , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , John Hubbard , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, Hugh Dickins , Qi Zheng Subject: Re: [PATCH 01/12] mm/huge_memory: zap deposited page tables after an RCU grace period Message-ID: <20260901160616.GD56830@ziepe.ca> References: <20260901-rcu-pagetable-freeing-v1-0-5456a81c8212@kernel.org> <20260901-rcu-pagetable-freeing-v1-1-5456a81c8212@kernel.org> <20260901142408.GA56830@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260901_090619_310315_DDD6CED7 X-CRM114-Status: GOOD ( 23.55 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Sep 01, 2026 at 11:54:47AM -0400, Liam R. Howlett wrote: > On 26/09/01 04:28PM, Kiryl Shutsemau wrote: > > On Tue, Sep 01, 2026 at 03:41:17PM +0100, Lorenzo Stoakes (ARM) wrote: > > > On Tue, Sep 01, 2026 at 11:24:08AM -0300, Jason Gunthorpe wrote: > > > > On Tue, Sep 01, 2026 at 03:12:45PM +0100, Lorenzo Stoakes (ARM) wrote: > > > > > > > > > It won't be costly at the time of the calls obviously as its deferred. Maybe > > > > > increase some time spent in softirq but again is 512x that big of a deal? > > > > > > > > > > I'm not sure how you'd both defer the free and somehow utilise mmu_gather here > > > > > either really, certainly not without it becoming extremely messy. > > > > > > > > The less costly version is to thread the page to be freed onto the > > > > mmu_gather through a linked list in the struct page memory. This is > > > > super cheap since it is just a singly linked list operation. > > > > > > > > Then when the mmu_gather is flushed it does a single call_rcu using > > > > the rcu head of the struct page of the head of the list. The callback > > > > clears the entire linked list of pages. > > If you are going through the trouble of doing this on your side with a > custom rcu callback, it might be better to pack the pointers in a way > that does not need to pointer chase through a linked list. Well, I have 8 bytes of memory in a struct page and can't allocate in these paths, so IDK there is another option.. Jason _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv