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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 75BEFC624D5 for ; Tue, 1 Sep 2026 16:06:24 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4hZ9hZ5J9bz2xmh; Wed, 02 Sep 2026 02:06:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::734" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788278782; cv=none; b=PpqLyLj8G7OTQIEpnDj3mtMRXJqsRO8OvsJfTIlI+nwt4uEdlknYo9lAo6sY2kuHmxTD1KJZmMxj9jIt6ZyHyI6SmxtwBunZQv9ikvjOnuXThZu/nD5dPl+ZrhMn5nh/kvP3UsFFwm8h1vUeMZPZck7+gp4KBEzYCWSdPOTKhHEtgc39nJZgW0Sv0a+9hUH1dEx/2ZRzuA494jXj32V/oXEPvIo2OGoTd/T39ll4Qi0lt5v2go6fLJUXJMDb9d5H6kylNrvGEEXfjBnU1RgCTy6YCfO3L3Tki1mTFLBjXIaJOGvOGqqxYyGXRR9l4v5eZ9f3vKTxknEQHpJRk13Q9Q== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788278782; c=relaxed/relaxed; bh=wqCXc1d2wL50duIrdszOJfzq0EqANvFRgXietPv5nSU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UrH7yKNaboc8AFVzRLtLBczELmvOTPKgMe9i+fJVfqGB3uAA4JhBna508Fl9NiEqzafGzx1KvGQSg+TlHF6EhlJaMRO6ldxFJtI0LYQzI+ZMtP7NwIMPstdctwj84GCgVyPrWJ3JWauFwhYLiuGvCXNzZNY9ZeZRHryv+LkKwjtFiYb8v+yCGC6faoBTymLkqj8i0zN3fcTRd+DIv/gctt/97LozprhMYO4XFyQrqChn5Ep6KT6ZXM5Gj2BAd2gPZlxSEq6CNgSEZS4Iqo0EauMLOMdehxHMP2QYqj2N3pA8N1oUnUCDSsKus3qlIW8Gjt4o23BK8GfYidiyEhdqyw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=V9Jx6iP0; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::734; helo=mail-qk1-x734.google.com; envelope-from=jgg@ziepe.ca; receiver=lists.ozlabs.org) smtp.mailfrom=ziepe.ca Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=V9Jx6iP0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ziepe.ca (client-ip=2607:f8b0:4864:20::734; helo=mail-qk1-x734.google.com; envelope-from=jgg@ziepe.ca; receiver=lists.ozlabs.org) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4hZ9hY4Jc4z2xBK for ; Wed, 02 Sep 2026 02:06:20 +1000 (AEST) Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-92ea24a2dbfso10714685a.0 for ; Tue, 01 Sep 2026 09:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1788278778; x=1788883578; darn=lists.ozlabs.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=V9Jx6iP0lIyQJgv39CCANKJ8Wwm74ieeITgN2+FUxSO7MheX62qgFAEGxHZElwNYbI G2vGNvyE362ibpriHNTfkiAiF1kZ6+/MDCRkjMvs4Wo9QgSNpEhwpARb7UtiA3hasyVV JDVtoHn6KXw/FXPyB4Blia3CPn0ewjsVNzN3MniNBYWdMK9V4Mkw4UGKX50cLwFw8lXv NNwuUyCme+Vy6IRz4mf7rH7yKNRZxqYAAP6YXlrVijYEhG0Yy9JZIrEj44r+Xcbpcv0o ndFGq8xohFpyBYPrGXXbYoO0umTQrRGVWNI1/7ypKup6CjtPw9aeV/GpMpPYjIwx521G 5hhg== 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=jP+9tnpUnFRU/dGy/IqE7mdKauiJcodQjytlTpwbYD7CuxL5B+29vJSHfr+YZpyLmE zLQv5/LxXzVtbOCYfoRsqeKT4DbiKwtU7zIirE5kaCPeyTgwVRC1lyVSjhXBAVevne/0 xEuZ8RXj5LSoGyXdTAhrtke2w2mFQThkC+fVLV8FFiW73OM24kpAoUdpAlINqPJfIuT+ Ls5hJ9qilPC1GlNZzNwbZe6j2/bVdrSfulYsJUyjdUjTI/sPJJLT3OC+LnChOJrHDsF9 nHXDQ3ZT9d7dw97/Z6W91OHZXOMllvAzFyoHxHU+zHBAUFQRUs3HL4rI5ar9NGw11PPw iP4A== X-Forwarded-Encrypted: i=1; AHgh+RoQ++dh4LNSGlWVx8LZeywOIEoVll777TMpze/b7QUmvZS+OB2IsuZU9cSqI6dirRwa65dPXUDfSVvTjz4=@lists.ozlabs.org X-Gm-Message-State: AFuF++k3zyiVF4puZXShXpdBAaIRAyh62tNnfo0eLPpZM4NaIUAOqfdS jBc6TLH+dBs2hA9XXCWG19sPOb0sftvrJJjNcI3IxT/k/JFW+hdyJa8EaoQ3ZrOWem4= X-Gm-Gg: AR+sD12yLswrFusLPsA2I/IChA+B+mykRIDh5EcNCgNxVAWvcntgB81XKPsGZmK3Vx/ PVYK+G9aVnmWLoE/QsEFU4Sq8CnpSnUcW2je67qqTMslVc2Kq8ItnsNOzdvONp8eojpopS57OKA r65OGt4V/NgEFZN2Mj9RzFj7MAEA8HW/Y3rmLjVGua0WwlCZ/Up8dwSXRAXdvJXQS/bwkFq1D9a WKfbl5VFPLit8qmPZfufHD0k9y6H/Px0s9jNBBqTON4RC5F/ZnODwemXCycRJzaXklpvfEdu8Ii x3JjHvpAN9byX4VztTdiGyZPfWm9ougOmuoQXjxiV9+me3eV2ix9TLHTVEHfp0J9YVYl/ztKxUc J0I4kpbQwpmgti0d31JxToC2Qs7x51OYdk82mKJudJjJHqvx/nnk/EidAQgL6LUhEx+UMvMcbNj ButoJ7JCLzaqWkiOQmQ17J9m+vspt+QFHlSmd92xRmvW0rmZEWFwP1UyW8+klNFAC0YaTK3BAFj xYWHdSDt2Ul5aMXwk9LSGkTe4b5iFD+FCw49T35i4iVBA== 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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list 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