public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: lirc@bartelmus.de (Christoph Bartelmus)
To: torvalds@linux-foundation.org
Cc: akpm@linux-foundation.org
Cc: apw@shadowen.org
Cc: kosaki.motohiro@jp.fujitsu.com
Cc: kyle@infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] make checkpatch warn about access to current->comm
Date: 27 Jan 2009 19:15:00 +0100	[thread overview]
Message-ID: <Aufg85sZjFB@christoph> (raw)
In-Reply-To: <alpine.LFD.2.00.0901270741490.3123@localhost.localdomain>

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

  parent reply	other threads:[~2009-01-27 18:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 19:32 get_task_comm() not exported? Christoph Bartelmus
2009-01-18 22:36 ` KOSAKI Motohiro
2009-01-20 21:24   ` Christoph Bartelmus
2009-01-27  5:09     ` [PATCH] export get_task_comm() KOSAKI Motohiro
2009-01-27  5:16       ` Andrew Morton
2009-01-27  5:19         ` Kyle McMartin
2009-01-27  5:26           ` Andrew Morton
2009-01-27  5:29             ` Andrew Morton
2009-01-27  5:39               ` [PATCH] make checkpatch warn about access to current->comm Kyle McMartin
2009-01-27  5:50                 ` KOSAKI Motohiro
2009-01-27  5:52                   ` Kyle McMartin
2009-01-27  5:58                     ` KOSAKI Motohiro
2009-01-27  6:09                       ` Kyle McMartin
2009-01-27 15:45                 ` Linus Torvalds
2009-01-27 15:57                   ` Kyle McMartin
2009-01-27 18:15                   ` Christoph Bartelmus [this message]
2009-01-27  8:49               ` [PATCH] export get_task_comm() Alexey Dobriyan
2009-01-27  9:00                 ` Andrew Morton
2009-01-27 10:15                   ` KOSAKI Motohiro
2009-01-27 15:41         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Aufg85sZjFB@christoph \
    --to=lirc@bartelmus.de \
    --cc=akpm@linux-foundation.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox