mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Zi Yan" <ziy@nvidia.com>
Cc: "Zhen Ni" <zhen.ni@easystack.cn>, <vbabka@kernel.org>,
	<surenb@google.com>, <mhocko@suse.com>, <jackmanb@google.com>,
	<hannes@cmpxchg.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v11 2/4] mm/page_owner: add NUMA node filter
Date: Thu, 25 Jun 2026 13:04:45 -0700	[thread overview]
Message-ID: <20260625130445.347e3fcc6d271b988fceacd4@linux-foundation.org> (raw)
In-Reply-To: <DJIDMIBR7QP0.14KBT460GECAV@nvidia.com>

On Thu, 25 Jun 2026 15:27:57 -0400 "Zi Yan" <ziy@nvidia.com> wrote:

> >  
> >  	/*
> >  	 * Maximum input length for filter commands:
> > -	 * 32: print_mode command max length is 17 ("mode=stack_handle").
> > +	 * - 32: print_mode command max length is 17 ("mode=stack_handle")
> > +	 *        with sufficient buffer
> > +	 * - 6 * MAX_NUMNODES: worst case for nid list
> > +	 *   Worst case per node: ",NNNNN" (comma + 5-digit node number) = 6 bytes
> >  	 */
> > -	max_input_len = 32;
> > +	max_input_len = 32 + 6 * MAX_NUMNODES;
> >  
> >  	if (count > max_input_len)
> >  		return -EINVAL;
> 
> Hi Andrew,
> 
> This needs to be fixed as well.

yep, I did that in the obvious way:

@@ -934,14 +961,20 @@ static ssize_t page_owner_write(struct f
 	char *token;
 	int ret;
 	struct page_owner_filter_state *state = file->private_data;
+	nodemask_t new_nid_filter;
+	bool new_nid_filter_enabled;
 	enum page_owner_print_mode new_print_mode;
 	unsigned long flags;
 
 	/*
 	 * Maximum input length for filter commands:
-	 * 32: print_mode command max length is 17 ("mode=stack_handle").
+	 * - 32: print_mode command max length is 17 ("mode=stack_handle")
+	 *        with sufficient buffer
+	 * - 6 * MAX_NUMNODES: worst case for nid list
+	 *   Worst case per node: ",NNNNN" (comma + 5-digit node number) = 6
+	 *   bytes
 	 */
-	if (count > 32)
+	if (count > 32 + 6 * MAX_NUMNODES)
 		return -EINVAL;
 
 	kbuf = memdup_user_nul(buf, count);


  reply	other threads:[~2026-06-25 20:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25  4:30 [PATCH v11 0/4] mm/page_owner: add per-fd filter infrastructure for print_mode and NUMA filtering Zhen Ni
2026-06-25  4:30 ` [PATCH v11 1/4] mm/page_owner: add print_mode filter Zhen Ni
2026-06-25 18:26   ` Zi Yan
2026-06-25 19:20     ` Andrew Morton
2026-06-25 19:24       ` Zi Yan
2026-06-29  2:59   ` Ye Liu
2026-06-29  9:30     ` Vlastimil Babka (SUSE)
2026-07-03  8:14       ` zhen.ni
2026-07-03  8:51         ` Vlastimil Babka (SUSE)
2026-07-07  6:29           ` zhen.ni
2026-06-25  4:30 ` [PATCH v11 2/4] mm/page_owner: add NUMA node filter Zhen Ni
2026-06-25 18:37   ` Zi Yan
2026-06-26  8:20     ` zhen.ni
2026-06-25 19:27   ` Zi Yan
2026-06-25 20:04     ` Andrew Morton [this message]
2026-06-25  4:31 ` [PATCH v11 3/4] tools/mm: add page_owner_filter userspace tool Zhen Ni
2026-06-25  4:50   ` Andrew Morton
2026-06-29  8:31     ` zhen.ni
2026-06-25  4:31 ` [PATCH v11 4/4] mm/page_owner: document page_owner filter Zhen Ni
2026-06-25  4:55 ` [PATCH v11 0/4] mm/page_owner: add per-fd filter infrastructure for print_mode and NUMA filtering Andrew Morton
2026-06-25 12:57   ` zhen.ni
2026-06-25 18:22 ` Zi Yan

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=20260625130445.347e3fcc6d271b988fceacd4@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=zhen.ni@easystack.cn \
    --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

Powered by JetHome