[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8C830352-11B1-4D7C-84C4-F5D5F7008F63@oracle.com>
Date: Wed, 23 Apr 2025 18:22:54 +0000
From: Libo Chen <libo.chen@...cle.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: "peterz@...radead.org" <peterz@...radead.org>,
"mgorman@...e.de"
<mgorman@...e.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"juri.lelli@...hat.com" <juri.lelli@...hat.com>,
"vincent.guittot@...aro.org"
<vincent.guittot@...aro.org>,
"tj@...nel.org" <tj@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"llong@...hat.com"
<llong@...hat.com>,
"kprateek.nayak@....com" <kprateek.nayak@....com>,
"raghavendra.kt@....com" <raghavendra.kt@....com>,
"yu.c.chen@...el.com"
<yu.c.chen@...el.com>,
"tim.c.chen@...el.com" <tim.c.chen@...el.com>,
"vineethr@...ux.ibm.com" <vineethr@...ux.ibm.com>,
Chris Hyser
<chris.hyser@...cle.com>,
Daniel Jordan <daniel.m.jordan@...cle.com>,
Lorenzo
Stoakes <lorenzo.stoakes@...cle.com>,
"mkoutny@...e.com" <mkoutny@...e.com>,
Dhaval Giani <Dhaval.Giani@....com>,
"cgroups@...r.kernel.org"
<cgroups@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] sched/numa: Add tracepoint that tracks the
skipping of numa balancing due to cpuset memory pinning
> On Apr 23, 2025, at 9:56 AM, Steven Rostedt <rostedt@...dmis.org> wrote:
>
> On Wed, 23 Apr 2025 16:50:15 +0000
> Libo Chen <libo.chen@...cle.com> wrote:
>
>> Correct me if I'm wrong but can you disallow any passed-in pointers to be
>> dereferenced when TP_printk() is executed? This is something you can check
>> at the build time, right?
>
> You can dereference if the pointer is to the content on the ring buffer.
> For instance, you can have:
>
> "%p*h", &__entry->val
>
> It dereferences to the content stored on the ring buffer.
>
> What we can't have is:
>
> "%p*h", __entry->val
Right, I was thinking something stricter such as disallowing point-type
field in TP_STRUCT__entry {} to avoid direct assignment to point-type
field so there will be no chance to have unsafe dereference but then I
realize C doesn’t have built-in mechanism to detect various types of
pointers at the compile time, maybe rust can do that. Anyway I give up.
Thanks,
Libo
>
> -- Steve
Powered by blists - more mailing lists