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 5DE9F37EFF9 for ; Fri, 24 Apr 2026 20:15:03 +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=1777061703; cv=none; b=bCwzHoptX9tyFHXH7ldPfVi9ONh5LCjdQ71EGnEoZyyrxpFSQJuxm1MeKv9EwRfVF4flyhieSu68pWYlKnU+bfw4WJwXyp47MNcVjWa8sXdTtH9iCSEp2Yah4zlp+/byXe5dYFCw+cQZFiXaTwhRa5x04kFmjS+BWOrWlLfCh3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777061703; c=relaxed/simple; bh=KzUsrlEb2R7AENvAL26H/Py4Pqyr7OWqzEYkyunJd3A=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=DSAyAbiiEmvbT9mpmGeOaSS5JqLl7tesLAyHPpMfJG+MiSbP3WhoVhQMqwUlJ8R/KF3g1ZhQQSrCBr5OdnWm1YQzmg306bniTPiBCNfgz/RCCxagfTi3pkAL02LBhyfQf3YyU5jeFHTCZouuAhEjDf5wLk//rsLDCOdNOE3nQZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=OJNnK0HS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="OJNnK0HS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7E3CC19425; Fri, 24 Apr 2026 20:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777061703; bh=KzUsrlEb2R7AENvAL26H/Py4Pqyr7OWqzEYkyunJd3A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OJNnK0HSXi9E+Fb3ZfHo/+IPhlqS+r81QfXB6vlpyEwCzfIxIbR2dmxdenoSyovNz Tl/j5YX8+8Y9NDwMmJpOA8zOxCCprEAye3stUkRl6sq8HBv5oBhtmHCz6Vfq5fZTuv HUtUPFNA+h+wyC35y2gNUbROtTAJ9nYHInjoHqMc= Date: Fri, 24 Apr 2026 13:15:02 -0700 From: Andrew Morton To: Zhen Ni Cc: vbabka@kernel.org, surenb@google.com, mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] mm/page_owner: add NUMA node filter with nodelist support Message-Id: <20260424131502.3143b9cb291a4e6817aa9ed7@linux-foundation.org> In-Reply-To: <20260419155540.376847-4-zhen.ni@easystack.cn> References: <20260419155540.376847-1-zhen.ni@easystack.cn> <20260419155540.376847-4-zhen.ni@easystack.cn> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Sun, 19 Apr 2026 23:55:40 +0800 Zhen Ni wrote: > Add NUMA node filtering functionality to page_owner to allow > filtering pages by specific NUMA node(s) using nodelist format. > > The filter allows users to focus on pages from specific NUMA nodes, > which is useful for NUMA-aware memory allocation analysis and debugging. AI review (https://sashiko.dev/#/patchset/20260419155540.376847-1-zhen.ni@easystack.cn) wonders if it's legitimate to use READ_ONCE/WRITE_ONCE against a nodemask_t. And indeed, my x86_64 allmodconfig hit compile time asserts over this. So I took them out: --- a/mm/page_owner.c~mm-page_owner-add-numa-node-filter-with-nodelist-support-fix +++ a/mm/page_owner.c @@ -732,7 +732,7 @@ read_page_owner(struct file *file, char continue; /* NUMA node filter using bitmask */ - mask = READ_ONCE(owner_filter.nid_mask); + mask = owner_filter.nid_mask; if (!nodes_empty(mask)) { int nid = page_to_nid(page); @@ -1049,7 +1049,7 @@ static ssize_t nid_filter_write(struct f goto out_free; } - WRITE_ONCE(owner_filter.nid_mask, mask); + owner_filter.nid_mask = mask; ret = count; out_free: @@ -1059,7 +1059,7 @@ out_free: static int nid_filter_show(struct seq_file *m, void *v) { - nodemask_t mask = READ_ONCE(owner_filter.nid_mask); + nodemask_t mask = owner_filter.nid_mask; if (nodes_empty(mask)) seq_puts(m, "-1\n"); _