Messages in this thread | | | Date | 27 Jan 2009 19:15:00 +0100 | From | (Christoph Bartelmus) | Subject | Re: [PATCH] make checkpatch warn about access to current->comm |
| |
On 27 Jan 09 at 07:45, Linus Torvalds wrote: > On Tue, 27 Jan 2009, Kyle McMartin wrote: >> >> Suggest using the get_task_comm accessor versus direct access to >> current->comm.
> I think "current->comm" is fine, and not racy. > > It only gets racy when you ask for the name of _another_ task. > > And quite frankly, I don't think anybody but /proc does that anyway. I > think this whole "get_task_comm()" thing is overrated. Most people are > better off doing just "current->comm".
This issue only came up because for someone like me it's not obvious at all that using "current->comm" is safe and the comment in sched.h explicitly points out that task_struct.comm should be accessed with [gs]et_task_comm.
Christoph
| |