public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Lorenzo Stoakes <ljs@kernel.org>, Zi Yan <ziy@nvidia.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	 Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	 Barry Song <baohua@kernel.org>,
	Lance Yang <lance.yang@linux.dev>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH 1/2] mm: huge_memory: use sysfs_match_string() in defrag_store()
Date: Thu, 2 Apr 2026 07:37:26 -0700	[thread overview]
Message-ID: <ac55BrZEXDw1Mt7q@gmail.com> (raw)
In-Reply-To: <1bd5618b-f21e-4f87-85fb-e581d1efb803@kernel.org>

On Thu, Apr 02, 2026 at 03:45:25PM +0200, David Hildenbrand (Arm) wrote:
> On 4/2/26 15:42, Breno Leitao wrote:
> > On Thu, Apr 02, 2026 at 10:21:30AM +0200, David Hildenbrand (Arm) wrote:
> >> On 3/20/26 17:05, Breno Leitao wrote:
> >>> +enum defrag_mode {
> >>> +	DEFRAG_ALWAYS		= 0,
> >>> +	DEFRAG_DEFER		= 1,
> >>> +	DEFRAG_DEFER_MADVISE	= 2,
> >>> +	DEFRAG_MADVISE		= 3,
> >>> +	DEFRAG_NEVER		= 4,
> >>> +};
> >>
> >> These numbers should get assigned as default (C standard) I think, and
> >> can be dropped.
> >
> > You're correct that they would be assigned by default. However, I've
> > explicitly set them to clarify that we iterate over these enum values
> > using an integer and require these specific values.
> >
> > This was discussed in the previous patch series:
> >
> > https://lore.kernel.org/all/20260308140530.9ab6d1445d0936467eab4aef@linux-foundation.org/
> >
> > Please let me know if it should be removed here, and I will update the
> > patch,
>
> It's ok to leave it. It's just ... unnecessary :)
>
> What I saw in the past is that we highlight it by only setting the "= 0"
> on the first entry.

Understood. You're right that I was overly verbose here.

Thanks for the review,
--breno


  reply	other threads:[~2026-04-02 14:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 16:05 [PATCH 0/2] mm: huge_memory: clean up defrag sysfs with shared data tables Breno Leitao
2026-03-20 16:05 ` [PATCH 1/2] mm: huge_memory: use sysfs_match_string() in defrag_store() Breno Leitao
2026-04-02  8:21   ` David Hildenbrand (Arm)
2026-04-02 13:42     ` Breno Leitao
2026-04-02 13:45       ` David Hildenbrand (Arm)
2026-04-02 14:37         ` Breno Leitao [this message]
2026-04-03  5:09   ` Lance Yang
2026-04-03  6:46   ` Barry Song
2026-03-20 16:05 ` [PATCH 2/2] mm: huge_memory: refactor defrag_show() to use defrag_flags[] Breno Leitao
2026-04-02  8:24   ` David Hildenbrand (Arm)
2026-04-03  5:12   ` Lance Yang
2026-04-03  6:56   ` Barry Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac55BrZEXDw1Mt7q@gmail.com \
    --to=leitao@debian.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=kernel-team@meta.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox