Re: [PATCH 3/3] comm: ext4: Protect task->comm access by usingget_task_comm()

From: Ted Ts'o
Date: Sat May 07 2011 - 12:31:04 EST


On Wed, May 04, 2011 at 04:55:10PM -0700, John Stultz wrote:
> > I'm suspecting that approximately 100% of the get_task_comm() callsites
> > are using it for a printk, so how about we add a %p thingy for it then
> > zap lots of code?
>
> DaveH suggested the same, actually. And that would work with the
> seqlocking pretty easily to avoid DavidR's issue.

+1 for a %p thingy for printk's; although the other potential use case
that we should think about is for tracepoints. Getting something that
works for ftrace as well as perf would be a really good thing.

I suspect what we would want to do though (since people have been
trying very hard to keep the trace records as small as possible, so we
can include as much as possible) is to only record the pid, and have a
tracepoint which reports when process's comm value has been set to a
new value. So any objections to adding a tracepoint in
set_task_comm()?

And would you like me to send the patch, or do you want to do it since
you're putting a patch series together anyway?

- Ted

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/