From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6110126D4CA for ; Thu, 19 Mar 2026 17:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773940698; cv=none; b=fCweRZww+OFxTNxRqGb0U5OvyJm9ZII4cIjJthCf3gtIP53Zi21k5nNkuH3nrBelEik73v8VH2gRinEtxlqBCQ73G0ge+n+bU/uXoAa66QnyFn2ddRNNzrs+mZ2olEh83TQp/zLLo8vx/p5hIEPgzx8Wy1ZvQTlJxCH++9cqyiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773940698; c=relaxed/simple; bh=YAOwpycBW4bl7GnjppU5EEIluuBvfSAoerycfCrlHZw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lPY4IywXPHJOg9Vy6w6hWxHYngKgE0vcOuiD4HXOJn94SJjT/fDGayRbkE/Lri1mzDNjPUCCbv+nKDzyqkdU8ApdlVtwxlz+hptjHF0iI4HK6Ny35SpTUZdUm/1hrvyVARxS8o+E3ugWijx+kfz54X8HyCYCWRlFW6YKc2AOXsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GyE1OotQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GyE1OotQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 495DCC19424; Thu, 19 Mar 2026 17:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773940698; bh=YAOwpycBW4bl7GnjppU5EEIluuBvfSAoerycfCrlHZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GyE1OotQAS+3VGWCbSahRJe5oeEe05aV/pm9mjIdeQcmPtZyiRwiXhNaiBclivw5i BQIRT2zVSCIETwasZMxxONivVibXltFs6pOx1aVUihoKSPr0R+Bewgg7EIrC9JGVRc FGTHlOob/zPpnzkdGJtQSlxlzafXQsgmnD2MEoHitCxSCL1QuhDmIxqGkRjml4zpVp Kkcs/QKpG/+30pARtme8gicHeRykVWm0b1crDSKAgnt05/A5wxAMYuALVQFVrpPVB9 PWuMVvF08/geD9pNt7cc9URj3Gy7NiPTlVB3S1DkeA3gIWsr8vP5fdW0bpD+RtSPE0 rTVGg+2rrOU4Q== Date: Thu, 19 Mar 2026 17:18:11 +0000 From: "Lorenzo Stoakes (Oracle)" To: Kiryl Shutsemau Cc: Andrew Morton , David Hildenbrand , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/9] mm/huge_memory: deduplicate zap deposited table call Message-ID: <420f1b11-3b62-46dc-be33-58fbd5a4c8b3@lucifer.local> References: <29fa4129cd560681c67433b4c344b2c9a027d1b4.1773924928.git.ljs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@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 Thu, Mar 19, 2026 at 05:03:10PM +0000, Kiryl Shutsemau wrote: > On Thu, Mar 19, 2026 at 01:00:13PM +0000, Lorenzo Stoakes (Oracle) wrote: > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > > index 499c31bf8f83..c4e00c645e58 100644 > > --- a/mm/huge_memory.c > > +++ b/mm/huge_memory.c > > @@ -2431,6 +2431,7 @@ bool zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, > > pmd_t *pmd, unsigned long addr) > > { > > struct folio *folio = NULL; > > + bool needs_deposit = false; > > I think 'has_deposit' is a better name here. That's fine, can rename. > > And initialize it to arch_needs_pgtable_deposit(). Yeah I considered that, but then you have to do logic like: has_deposit = has_deposit || ; Which is a bit ugly. Could do has_deposit |= But then that's weird with bools. Could be has_non_arch_deposit but that's too long and... yeah :>) > > -- > Kiryl Shutsemau / Kirill A. Shutemov Cheers, Lorenzo