From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: akpm@linux-foundation.org, joe@perches.com,
keescook@chromium.org, geert@linux-m68k.org, jkosina@suse.cz,
viro@zeniv.linux.org.uk, davem@davemloft.net,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] Change task_struct->comm to use RCU.
Date: Tue, 25 Feb 2014 09:49:40 +0800 [thread overview]
Message-ID: <530BF6B4.3040206@cn.fujitsu.com> (raw)
In-Reply-To: <201402172027.BFH81210.FJtOQOMLHFSVOF@I-love.SAKURA.ne.jp>
CC scheduler people.
I can't figure out what we get with this patch.
On 02/17/2014 07:27 PM, Tetsuo Handa wrote:
> Tetsuo Handa wrote:
>> This is a draft patch which changes task_struct->comm to use RCU.
>
> Changes from previous draft version:
>
> Changed "struct rcu_comm" to use copy-on-write approach. Those multi-thread
> or multi-process applications which do not change comm name will consume
> memory for only one "struct rcu_comm".
>
> Changed do_commset() not to sleep.
>
> Changed to tolerate loss of consistency when memory allocation failed.
>
> Fixed race condition in copy_process().
>
> Regards.
> ----------
>>From ada6c4d94f5afda36c7c21869d38b7111a6fe9bc Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Date: Mon, 17 Feb 2014 14:32:11 +0900
> Subject: [PATCH] Change task_struct->comm to use RCU.
>
> This patch changes task_struct->comm to be updated using RCU
> (unless memory allocation fails).
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
> fs/exec.c | 145 +++++++++++++++++++++++++++++++++++++++------
> include/linux/init_task.h | 4 +-
> include/linux/sched.h | 37 ++++++++++--
> kernel/fork.c | 9 +++
> kernel/kthread.c | 4 +-
> kernel/sched/core.c | 2 +-
> 6 files changed, 173 insertions(+), 28 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index a781dec..8a68ab3 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -263,6 +263,11 @@ extern char ___assert_task_state[1 - 2*!!(
>
> /* Task command name length */
> #define TASK_COMM_LEN 16
> +struct rcu_comm {
> + char name[TASK_COMM_LEN];
> + atomic_t usage;
> + struct rcu_head rcu;
> +};
>
I think the name "rcu_comm" is not good, I suggest that s/rcu_comm/task_comm/g.
next prev parent reply other threads:[~2014-02-25 1:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201402072303.DJD13007.JFFMSLHOOFQOtV@I-love.SAKURA.ne.jp>
[not found] ` <20140207140536.943daf965008b9428cdcb468@linux-foundation.org>
[not found] ` <201402081055.BGJ73403.tQMLFVOJSOOFFH@I-love.SAKURA.ne.jp>
[not found] ` <20140207180647.5944fe3d.akpm@linux-foundation.org>
[not found] ` <201402092327.JAD12489.QOLSFVMHJtFOOF@I-love.SAKURA.ne.jp>
2014-02-10 13:43 ` [PATCH (draft)] Change task_struct->comm to use RCU Tetsuo Handa
2014-02-17 11:27 ` [PATCH] " Tetsuo Handa
2014-02-24 23:51 ` Paul E. McKenney
2014-02-26 13:44 ` Tetsuo Handa
2014-02-26 15:26 ` Paul E. McKenney
2014-02-25 1:49 ` Lai Jiangshan [this message]
2014-02-25 10:05 ` Peter Zijlstra
2014-02-25 12:54 ` Tetsuo Handa
2014-02-25 14:46 ` Peter Zijlstra
2014-03-07 12:20 ` Tetsuo Handa
2014-03-07 15:54 ` Richard Guy Briggs
2014-03-08 12:43 ` Tetsuo Handa
2014-03-10 20:21 ` Richard Guy Briggs
2014-03-11 12:02 ` Tetsuo Handa
2014-03-11 12:16 ` Tetsuo Handa
2014-03-11 13:55 ` James Morris
2014-03-24 15:43 ` Richard Guy Briggs
2014-03-27 17:20 ` [PATCH] LSM: Pass comm name via get_task_comm() [was: Re: [PATCH] Change task_struct->comm to use RCU.] Richard Guy Briggs
2014-03-27 18:06 ` Stephen Smalley
2014-09-19 3:30 ` Richard Guy Briggs
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=530BF6B4.3040206@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=jkosina@suse.cz \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/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