mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: penguin-kernel@I-love.SAKURA.ne.jp
Cc: john.stultz@linaro.org, tytso@mit.edu, mina86@mina86.com,
	jirislaby@gmail.com, rientjes@google.com, dave@linux.vne,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] v4 Improve task->comm locking situation
Date: Wed, 18 May 2011 13:10:44 +0900	[thread overview]
Message-ID: <4DD346C4.5030200@jp.fujitsu.com> (raw)
In-Reply-To: <201105180316.p4I3G6f2094560@www262.sakura.ne.jp>

(2011/05/18 12:16), Tetsuo Handa wrote:
> What about replacing
> 	char comm[TASK_COMM_LEN];
> with
> 	char *rcu_commname;
> and switching it atomically using RCU?
> 
> Advantages:
>    Readers can use RCU read lock rather than spinlock.
>    Makes task_struct smaller.
> 
> Disadvantages:
>    Need to allocate TASK_COMM_LEN bytes upon dup_task_struct() and set_task_comm().
>    Need to rewrite all task_struct.comm readers (steps shown below).
> 
> Steps to rewrite task_struct.comm readers
> 
> (1) Introduce a temporary accessor (say, task_comm).
> 
>      #define task_comm(tsk) (tsk)->comm
> 
> (2) Rewrite all tsk->comm users to task_comm(tsk).
> 
> (3) Replace sizeof(tsk->comm) with TASK_COMM_LEN.

The problem is, they aren't a few. But if you have a enough brave,
you can rewrite all. I'm not against it.





  reply	other threads:[~2011-05-18  4:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 21:19 John Stultz
2011-05-16 21:19 ` [PATCH 1/3] comm: Introduce comm_lock seqlock to protect task->comm access John Stultz
2011-05-16 22:01   ` Jiri Slaby
2011-05-17  1:47     ` John Stultz
2011-05-18  0:28   ` KOSAKI Motohiro
2011-05-16 21:19 ` [PATCH 2/3] printk: Add %ptc to safely print a task's comm John Stultz
2011-05-16 21:54   ` Jiri Slaby
2011-05-16 23:10     ` John Stultz
2011-05-16 23:56       ` Joe Perches
2011-05-17  0:11         ` John Stultz
2011-05-17  7:21         ` Jiri Slaby
2011-05-18  0:32   ` KOSAKI Motohiro
2011-05-16 21:19 ` [PATCH 3/3] checkpatch.pl: Add check for task comm references John Stultz
2011-05-16 21:29   ` Michal Nazarewicz
2011-05-16 21:34     ` David Rientjes
2011-05-16 23:04       ` Joe Perches
2011-05-16 23:11         ` Michal Nazarewicz
2011-05-16 23:22           ` Joe Perches
2011-05-18  3:16 ` [PATCH 0/3] v4 Improve task->comm locking situation Tetsuo Handa
2011-05-18  4:10   ` KOSAKI Motohiro [this message]
2011-05-18  4:15   ` John Stultz
2011-05-18  5:27     ` Tetsuo Handa

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=4DD346C4.5030200@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=dave@linux.vne \
    --cc=jirislaby@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mina86@mina86.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rientjes@google.com \
    --cc=tytso@mit.edu \
    /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

Powered by JetHome