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 ED023378D74 for ; Mon, 9 Mar 2026 09:21:03 +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=1773048065; cv=none; b=CzKQXAYO+OXQ8F0BGycoCNkVWJ8zlJiRSvBJmgB3yFUlmJ+WkQcxaB85W6LDpZwv3NyWzTfFOkIliWRukb/3oD+5rz78rqkUwFr3l0wIcSeqvhmmv37JXECUVaUOPKF8crBp0KNmAPt/SKl9oh62xk8ecwW0I5zqe5fs2s0Rh5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773048065; c=relaxed/simple; bh=S+ny/4BRw+U8HBcaJIyWNEQFWgxWUpPRJrO6Xpc+WgU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=msYiH8pGPXSuCwXXoPyOR6GXldpiyet0xIvfTDLellDqL/+YJfTUaLN0eSkKUw078gxaolRIZOGjwgIcNQL1w3MvIwL/zwDpSKAvPAcyHrc0teE1voIWydjy8N0+o9u6ZNgn0/vHXHa9ICU8R2cv3ucQ/7p8Ljv9qwuSPRo3WzQ= 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=grKOV7J3; 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="grKOV7J3" 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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DFuJec4H2+P8uy4f99EliGjNhZsMpP0TMfZif0dlTmg=; b=grKOV7J3oVUX0lkZ9SfKH3a/27 f6Bk2FwEfIzs3Zny2Abzp7YtYcv6Muy74KXRejKo9lGCsZ1k5CfunR7pdYv2Lk6ymO4IruxiaocRK w1csjZjXh2mmZxuoWSqAEoAse0Us9jb8llF/KNOPuKMfdyerQdW2nrY3kZvHvqW0U5CIKPTk/+KdB XpJOAj9+pFLW0/LeEDgIxa2UTVEx3Ji7QdNwZiDLzY0rWbtqAIC/6UPqVQ5syjCon4NBaMgElvDGB 2Gozqy51n8MTJ6BNWVij1xja7uaJQ1qH6b9K58Vjpp+M5a7gx1ur9E0gUt5YzW90Iq9ZOVLZetlm/ +cgOKmtg==; 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 1vzWmq-0027JK-12; Mon, 09 Mar 2026 09:20:28 +0000 Date: Mon, 9 Mar 2026 02:20:20 -0700 From: Breno Leitao To: Andrew Morton Cc: 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, "Lorenzo Stoakes (Oracle)" Subject: Re: [PATCH v3 2/4] mm: huge_memory: refactor anon_enabled_store() with change_anon_orders() Message-ID: References: <20260307-thp_logs-v3-0-a45d2c8f3685@debian.org> <20260307-thp_logs-v3-2-a45d2c8f3685@debian.org> <20260308140530.9ab6d1445d0936467eab4aef@linux-foundation.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: <20260308140530.9ab6d1445d0936467eab4aef@linux-foundation.org> X-Debian-User: leitao On Sun, Mar 08, 2026 at 02:05:30PM -0700, Andrew Morton wrote: > On Sat, 07 Mar 2026 08:08:06 -0800 Breno Leitao wrote: > > --- a/mm/huge_memory.c > > +++ b/mm/huge_memory.c > > @@ -316,6 +316,20 @@ static ssize_t enabled_show(struct kobject *kobj, > > return sysfs_emit(buf, "%s\n", output); > > } > > > > +enum anon_enabled_mode { > > + ANON_ENABLED_ALWAYS, > > + ANON_ENABLED_MADVISE, > > + ANON_ENABLED_INHERIT, > > + ANON_ENABLED_NEVER, > > +}; > > If we're feeling fancy we could use > > ANON_ENABLED_ALWAYS = 0, > ... > > here, just to make it clear that we iterate over the enum values with > an integer and we *require* those values. > > > +static bool change_anon_orders(int order, enum anon_enabled_mode mode) > > +{ > > + static unsigned long *orders[] = { > > + &huge_anon_orders_always, > > + &huge_anon_orders_madvise, > > + &huge_anon_orders_inherit, > > + }; > > + bool changed = false; > > + int i; > > enum anon_enabled_mode m; > > might be clearer here? Thanks Andrew, let me respin it. --breno