From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 63D0F3B582A for ; Fri, 6 Mar 2026 16:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772815456; cv=none; b=BH2B95drjDw8fa143/j73NV0NajcqnCCZwG856p1TQCOl9bqZG8qYqaSXeHA4AByqPzCTr4lBJ3RN+VmGZthxymV03Rwkv1IvYdCUAmjI1N9WK2GJFygjSFz+YasJbde9sBjj5E9ke+R/DfkEu65W8YZPX+1HXrMzPAs/FJmn7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772815456; c=relaxed/simple; bh=FQVieUAaotG/Vwy8hL1CcO19BxJghydmXC5ROajNp9s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lG3IsYwWIk+UlPVPYCd0lL5R5VULqP0q5Fx6m/yZv5beVTXIPpaD1dJfBuT65/Vg3ytMOi/zzLfeFGxp4WU6ygcJ5uTxIqfWKpjTBqRFrbIwj5dVv5w+gc9NkL/zHhSRVvEzze1BWhpZMHXQcXVoYNPCXbF4HH1IgeQDU8xOTe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=nbpPjw4u; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="nbpPjw4u" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description; bh=FQVieUAaotG/Vwy8hL1CcO19BxJghydmXC5ROajNp9s=; b=nbpPjw4uWRr0rX+68AEmJTYihB jDoXB56NrOxP3UyoKmBu/zDMDzPyaTY+x7vKVgOG03OS9fkIf5SJK+TTwQwfeEhTCbKUpwYfaSVcf 3LtmAytssBjwWp+LOvKM0ZykTb84ERKP1N4Zf5o1l2ygVUffEhIeX7iX+luS29s6d0YPLw0PbWbzN PM8mCHVF/tnLIGkU09IHYqRkjHs96LLAJVhWzJvkxflKHIRasSDruhWNSUIx873U3NKZh8Z8UYmYh 7fxxk0Z3+a5FQNlPHNaqLaIeKhKUU5M+18O22YN07/1URQOS8Xixal2+6Zk3qM5S/aVQ/drBl9dJG WkRhnjbQ==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1vyYHI-0002ZQ-6T; Fri, 06 Mar 2026 16:43:52 +0000 Date: Fri, 6 Mar 2026 08:43:45 -0800 From: Breno Leitao To: "Lorenzo Stoakes (Oracle)" Cc: 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 , linux-mm@kvack.org, linux-kernel@vger.kernel.org, usamaarif642@gmail.com, kas@kernel.org, kernel-team@meta.com Subject: Re: [PATCH v2 2/3] mm: huge_memory: refactor anon_enabled_store() with change_anon_orders() Message-ID: References: <20260305-thp_logs-v2-0-96b3ad795894@debian.org> <20260305-thp_logs-v2-2-96b3ad795894@debian.org> <68156cf9-cf97-4435-b979-c2ab0d6a97b1@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <68156cf9-cf97-4435-b979-c2ab0d6a97b1@lucifer.local> X-Debian-User: leitao On Fri, Mar 06, 2026 at 11:32:44AM +0000, Lorenzo Stoakes (Oracle) wrote: > On Thu, Mar 05, 2026 at 06:04:54AM -0800, Breno Leitao wrote: > > Signed-off-by: Breno Leitao > > This is nice, you've improved my idea :) Thanks! Your idea was a good starting point, and digging deeper led me to sysfs_match_string(), which I wasn't familiar with before — it turned out to be exactly what we needed here. Having the modes in anon_enabled_mode_strings[] also opens the door to further simplification. I haven't thought it through completely yet, but I suspect we could consolidate quite a few of the _store()/_show() helpers as a follow-up. > I know you change another instance of this in 3/3, but I wonder if there are > other cases like this in the THP code we can fixup too? Yes, there are several other candidates — defrag_store, the ones Baolin Wang reported, shmem_enabled_store(), and thpsize_shmem_enabled_store() among them. I'd prefer to address those in a separate patch series once this one lands, if that works for everyone.