Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795906978; b=g+GLYIAVUX9NfNgNtqKQYzYA5p2CjzegfxCWIgW1zf2c/5xQ3plhCJu5A40U7VPai/ew yOtKTXP90uxsZ//XtnmL3Uk5F6dTTH/KKP1DxGvL4KdiKX6Ml6OREU1YYpB/LihHWj8RS jVFvNR7TKJo+XuwlP5GB4vpbUr0XrTtcdug/Iyi3vEAUVF6M5ho4SfOXEzthyEH3EP1CP rZEvMkSRxwFKsaNlSPPs8zqMxCAWA2Ty8V/ncLmzM+BTFZKl+hwJvnN/uTBlQxeozLVUc aEYO53NF8KdsxKTi4Z3R+o5bag56ZXNXiNBcLQTcOz3KCqE7sZYqzLUaSiXaCZ/dURQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795906978; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=TRAVfOYu3EbEU3rN4GtFMEZg2AgnLOrfcQMMQijGdSw=; b=1nI5D+t+YSkF15V4u9qYMztUirfdLnZlYG2ZwXpv3BgXk5CmMp65Hs4w1t6EuQex18Ej oKLKH5cv3UGrX27lOUzjR09GbavLBp9hriuqo//5z5bIOeB0EBhEJpTygJqOIyX+eyeYW xcdv86w2/ScXR1B9CemD7e27Lz9ut197fCAagwkDngWA/YCiOfVA5c3L7smCdCk8e3pUq /g1q4xOE8syuyvFk+WTOA8/FMRAT1Kde3GUi4h2hy3i35qn0qLkoNwNQSeau7rSGVUl4E S0ZU0VX9e0ssnMZxOXc/8ul7yYTx/K0RcpH6dIXrsz+G+//KPiu/KDfMNWwQUSPmC/Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MdQx4eDJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94894606A31C for ; Sat, 28 Nov 2026 23:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MdQx4eDJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84F6C1F00893; Sat, 28 Nov 2026 23:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795906978; bh=TRAVfOYu3EbEU3rN4GtFMEZg2AgnLOrfcQMMQijGdSw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=MdQx4eDJKyDlVE48C8kXvZiC4FzVGVUtXZxc/GOhKKjTpos84SSzYhPequXZ0PFNT qigIGILI8d6vdc30WeanECW1lFMmzaKrp3Z79u4w+x+WokMra5V88gWa1tQVtpbdjo jAA0UvOjTJMPw7yxRcDClLMRF/QPk3GlqIdPk4lmaKExK+leWGPiqlFFxJxwZ/I1Lr pZHu70nsG82Gvaxmg7qJzL1+WXZMKc/+u/r1DUPfrhpEn2Yr5aDtnllf0RKgtBk3uP UdI5DR3VbJCRCNQheB4U2nwc8ZbID74ALWNc1pi6/o43zWODx7kCCvR3JoDDjRzQOF lSXvuDILdAWww== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 10/11] sched/numa: bound cpuset trace masks by nr_node_ids Reply-To: sashiko-reviews@lists.linux.dev To: "Yury Norov" , "Andrew Morton" , linux-mm@kvack.org, "Rasmus Villemoes" , "David Hildenbrand" , "Gregory Price" , "Zi Yan" , "Joshua Hahn" , "Rakie Kim" , "Ying Huang" , "Muchun Song" , "Oscar Salvador" , "Johannes Weiner" , "Kairui Song" , "Thomas Bogendoerfer" , "Rafael J. Wysocki" , "Len Brown" , "Jens Axboe" , "Peter Zijlstra" , "Mel Gorman" , "Steven Rostedt" , "Masami Hiramatsu" , "Mathieu Desnoyers" , linux-trace-kernel@vger.kernel.org Cc: "Liam R. Howlett" , "Axel Rasmussen" , "Baolin Wang" , "Baoquan He" , "Barry Song" , "Linus Torvalds" , "Lorenzo Stoakes" , "Michal Hocko" , "Mike Rapoport" , "Qi Zheng" , "Shakeel Butt" , "Suren Baghdasaryan" , "Vlastimil Babka" , "Wei Xu" , "Yuanchu Xie" , "Yury Norov" In-Reply-To: <20261127230128.111933-11-ynorov@nvidia.com> References: <20261127230128.111933-1-ynorov@nvidia.com> <20261127230128.111933-11-ynorov@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 23:02:56 +0000 X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] sched/numa: unresolvable nr_node_ids in sched_skip_cpuset_numa TP_printk() -- commit 9899bfb4a5bbc8bb11767c04c29e4c3bd6fcb50c Author: Yury Norov sched/numa: bound cpuset trace masks by nr_node_ids This commit updates the sched_skip_cpuset_numa trace event to copy mem_allowed using nodes_copy_and_extend() and pass nr_node_ids instead of MAX_NUMNODES to TP_printk(). > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h > index 535860581f159..38a2a10cba429 100644 > --- a/include/trace/events/sched.h > +++ b/include/trace/events/sched.h > @@ -793,8 +793,9 @@ TRACE_EVENT(sched_skip_cpuset_numa, > __entry->ngid =3D task_numa_group_id(tsk); > BUILD_BUG_ON(sizeof(nodemask_t) !=3D \ > BITS_TO_LONGS(MAX_NUMNODES) * sizeof(long)); > - memcpy(__entry->mem_allowed, mem_allowed_ptr->bits, > - sizeof(__entry->mem_allowed)); > + /* Clear unused bits in the fixed-size trace field. */ > + nodes_copy_and_extend(*(nodemask_t *)__entry->mem_allowed, > + *mem_allowed_ptr); > ), > =20 > TP_printk("comm=3D%s pid=3D%d tgid=3D%d ngid=3D%d mem_nodes_allowed=3D%= *pbl", > @@ -802,7 +803,7 @@ TRACE_EVENT(sched_skip_cpuset_numa, > __entry->pid, > __entry->tgid, > __entry->ngid, > - MAX_NUMNODES, __entry->mem_allowed) > + nr_node_ids, __entry->mem_allowed) [Severity: Medium] Does passing nr_node_ids to TP_printk() break userspace trace parsers readi= ng the sched_skip_cpuset_numa format file? When MAX_NUMNODES > 1, nr_node_ids is a runtime C variable rather than a preprocessor constant. Stage 7 stringifies TP_printk() arguments directly = into the tracefs format file, emitting the literal identifier nr_node_ids into print fmt where tools like libtraceevent, perf, and trace-cmd cannot resolve it when decoding raw trace records. Since nodes_copy_and_extend() already zeroes all bits from nr_node_ids up to MAX_NUMNODES in __entry->mem_allowed, keeping MAX_NUMNODES in TP_printk() w= ill still format only the active runtime bit range via %*pbl while keeping the tracefs format file valid. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261127230128.1119= 33-1-ynorov@nvidia.com?part=3D10