From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 1F0BE43E078 for ; Tue, 1 Sep 2026 16:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788278781; cv=none; b=qvyF2FgcVfqgH0JqfKOsNnwbXYaXLpjfDxkMTn8bfwqxXTOD9VWx3SWjWVTtKu51EaEEJozeToHKltt3yxq7Vk1D3UynotDwyINlUSr1MD+fSS/O4IHP3b9PH92uJSGchP54VzDkdTZjmL8xZWxAQK7gS/B8yciW8JMoNci06YM= 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=V6tCTihY; arc=none smtp.client-ip=209.85.222.177 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="V6tCTihY" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-936cda0e3fbso8102885a.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.linux-m68k.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=V6tCTihYVx5xQd0WtsSzDNgizGvpWccZ5T5JS+yghYReY+XNx/GXNHMwKfr44tIGib U6m2jvmOJVJLtrJjAhK7yTn6KnzG7RpIPTO2Kx68uqpRFlwZoufDcrm2ZC4qhz26xQbU 4uv1vQQhaNjq0WYlUth7hcw5g+U8YCuDrmcii54rvLzxxZTFEme7+Q95PCcxTSgRlB0Y yDHTjfyYcD4iKnmadaWGBaXhrRLzRaJnX4GD/IyhrWUUyNqFOb9KRGuDmziJ5gQXQ/1+ FZM1uENdY7Jh9OhmR4Q16SlLEYPR0x72du255hN4hyccJ6VXE44t6kOA7SPE1Uup6VdH dFtw== 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=fKwZFZH4XDEHzTueoyuJ7S0eUE6Tnx4LAkjLOCASKZVKdsN5YkrznCxNK07gQbA0mf DUndirwppAlDxqAotH3CTdp+szZWq/9BB23z+B3wpF6xkPqgxCxcDPoytHVb14H5sg2K lSF8eRxbTUWwkXQfCZEwX1ZWhrGfxaaRFMf1PBD7ll8WknGnYa+A4nW1Bp3pb+dgSzvO HIZWRjDybt7Q56gPhSB0DXBPrn0Mcvdd6DYaJWWVj/in/UM0r9jkWPGuv78OEN9Ht5Ie Msh97eZimKVlTZ6R1WtkvIDKzv0ct4L+ECNvtSUA1Zw5gkPq6beQgGI/JTc+I6Y9OBUd lqJg== X-Forwarded-Encrypted: i=1; AHgh+Rp2cFmR0k1ar6WKxKN3HDDLV2NDAerK9f6jBgv0ldN9kWksFbhRJpKiKUBMYXyR8ErH1IrE0OPyRcOT@lists.linux-m68k.org X-Gm-Message-State: AFuF++l2xbZuIDsj2uljPL98p6sCwfEML/XIYGJHxg0F9Jy2Mi5ZFngB DVkeIBph8RYpTE0w54oKRJ6PThxKziw0e7wxuL7WvCme25+huS3DDMtBb/em29mWUAM= X-Gm-Gg: AR+sD12qXI/38Btb+a51/nhTXxnOLhnaFhHxGBZg6uoX8S5CCgWqPZIT+3aA3wjbupU 7JFq7DKemfpYrDZ5Q8cncF6r8BqtPZchq9cq6m/1i+3OTkT76fzuO8kSuRfa5XYAwFIVvwW6/sd GsZUtM/1U0NSHOLImXnv0LRmXk/Iws+LUoM29JV/FvteHCYkdRizWIs5++HYMVOqRPFpiRKXOnI P9n4wAa8uJmK4Uh+xmMA22PvqfRatrpA17E3RKP54flKZ+0cjyg2Nb5+wfySFWijJZnGUx/PpH8 TGHZ2zeg5tUETSH/SAu7teb2ibI0w6W8Qx0fL3pzDrW8YldQOuQDB4WqHZHuCEPD/zsYVSXKIJt lYtpD/c3eGCjwaSs/yLk2+OpN6n55pAhc0KyfPFTQNNtRB9cziS0CQ4bvkQ+gVSqU7dnVlRg+XA 3Rj9OA/SkMLnbmJfRcAqpTRV0zv3+GzIqTTSbZBK+sz+oV8pT0to2PyClZ337KSaVRWtsjf8XUu vLO8yaidBWgwFx3M8x3pDkZ+NjCL/ggiabigUNgULqhqg== 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: linux-m68k@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