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 A90A62D9796 for ; Tue, 17 Mar 2026 11:25:31 +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=1773746731; cv=none; b=FWliIN2VlR4n0nP+LgCnC6K4cbWCsC0cmwOo/S9LEAbEw7oSX9/df10wmCkYKh7BM2s3z/L208LEn+LTZfr/i2LH7euPkqC3d9BqRZrt62Zv8Hhv0oACSzmDQQin08dzJYYePZNzLa4pfd7i8QO8VXoGvrk3gpPbG1f6P84xVcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773746731; c=relaxed/simple; bh=9e+yKnCtiF4HEwCiCUAlH11+H/AH+F3Id7ThrSC/MIM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jR6RaIc0rrDmi6VSY8/3gAe84jh3lsd6zQWqWpwqvpdigpKMJe8wkRz4o+c38tkvh3gk4NkFQUiY2yQG3AD6YipiL7V8ZQjTbNzHlVZw28TnD2w5Tzg1hIKJ5x/VT77lotbW8D67puxnA43hGB20EjwLiOLHUE19wfTnP/fyWgk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f9jD/4Fk; 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="f9jD/4Fk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8AE3C19425; Tue, 17 Mar 2026 11:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773746731; bh=9e+yKnCtiF4HEwCiCUAlH11+H/AH+F3Id7ThrSC/MIM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f9jD/4FkF/y0X9YzGOpFSN1Lad+SwWaMRBPW1jCYGtk4hgpQDPZhDmhcTeASlEBnj lfnG3H3qkimaPi62i09w0qB871A2lew3z8hNrkmwJTcYI0dFjuugk0SQPEHGWEXCRb YZcgOOYJMOLpI3KUMUmO6rLQlMNZ4xm6c/ND5zkgeOd+SPdxJTIm/3UM5zuSzEJtqj y7xeOnWW7buC3u9mTIM3VhH5vvfBh3lCzw52qIMtlEgiS15XyZryrBCvmnU0zAjbzs eBDA8TQmS7lWnq5stQdTA3+JLAO0OXwSO2AnNfwA1yEdWL6k9ZmERg5ky/c6bm43hB B41H4jlXdccDw== Date: Tue, 17 Mar 2026 11:25:23 +0000 From: "Lorenzo Stoakes (Oracle)" To: Breno Leitao Cc: Sohil Mehta , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org, usamaarif642@gmail.com, kas@kernel.org, kernel-team@meta.com, Wei Yang , "Accardi, Kristen C" Subject: Re: [PATCH v6 3/4] mm: huge_memory: refactor enabled_store() with change_enabled() Message-ID: <8f873cbb-93ef-40d9-99c8-ce9970aefb82@lucifer.local> References: <20260311-thp_logs-v6-0-421e30d881e0@debian.org> <20260311-thp_logs-v6-3-421e30d881e0@debian.org> <322f6f2f-840e-462f-96b0-b603b9c88582@intel.com> <1b7d1bdf-c002-4543-b858-09fd2b1b73f9@lucifer.local> 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 Tue, Mar 17, 2026 at 04:23:37AM -0700, Breno Leitao wrote: > On Tue, Mar 17, 2026 at 09:37:39AM +0000, Lorenzo Stoakes (Oracle) wrote: > > > > Given the above I think we should switch back to the atomic accessors. > > > > We can address the broader issues with this horrible code in a separate > > series. > > Ack. let me respin then. Thanks! > > > > Overall, as you mentioned below, protecting transparent_hugepage_flags > > > with a spinlock seems like a better, long-term solution to me as well. > > > > Yeah, let's look at doing a follow up that cleans this up in general and > > address that then. > > Sure. I am planning to improve defrag_store() as the next work, and then > come up with this additional spinlock for transparent_hugepage_flags. > To be clear by the way by 'horrible code' I meant the existing logic with the globals etc. not your change which is positive and welcome :) Cheers, Lorenzo