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