Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-11 Thread Tetsuo Handa
Geert Uytterhoeven wrote: > On Sat, Jan 11, 2014 at 12:59 AM, Andrew Morton > wrote: > >> +char *comm_name(char *buf, char *end, struct task_struct *tsk, > >> + struct printf_spec spec, const char *fmt) > >> +{ > >> + char name[TASK_COMM_LEN]; > >> + > >> + /* Caller can pass N

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-11 Thread Pavel Machek
On Fri 2014-01-10 17:57:30, Andrew Morton wrote: > On Sat, 11 Jan 2014 10:28:51 +0900 Tetsuo Handa > wrote: > > > Andrew Morton wrote: > > > On Thu, 9 Jan 2014 21:52:00 +0900 Tetsuo Handa > > > wrote: > > > > > > > This patch introduces %pT format specifier for printing > > > > task_struct->

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-11 Thread Geert Uytterhoeven
On Sat, Jan 11, 2014 at 12:59 AM, Andrew Morton wrote: >> +char *comm_name(char *buf, char *end, struct task_struct *tsk, >> + struct printf_spec spec, const char *fmt) >> +{ >> + char name[TASK_COMM_LEN]; >> + >> + /* Caller can pass NULL instead of current. */ >> + if (!t

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-11 Thread Paul E. McKenney
On Sat, Jan 11, 2014 at 12:09:46PM +0900, Tetsuo Handa wrote: > Andrew Morton wrote: > > In the absence of step 3, steps 1 and 2 are rather pointless churn. > > > > So I think it would be better to merge (into mainline) steps 1 and 3 > > first and at the same time. Then start thinking about step

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Tetsuo Handa
Andrew Morton wrote: > In the absence of step 3, steps 1 and 2 are rather pointless churn. > > So I think it would be better to merge (into mainline) steps 1 and 3 > first and at the same time. Then start thinking about step 2. Unfortunately we can't. Step 2 depends on step 1 for avoiding compil

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Tetsuo Handa
Joe Perches wrote: > On Sat, 2014-01-11 at 10:59 +0900, Tetsuo Handa wrote: > > I just added noinline_for_stack as with other functions does. > > But indeed, stack used by name[] is only 16 bytes but stack used by function > > arguments are larger than 16 bytes. We should remove noinline_for_stack

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Joe Perches
On Sat, 2014-01-11 at 10:59 +0900, Tetsuo Handa wrote: > I just added noinline_for_stack as with other functions does. > But indeed, stack used by name[] is only 16 bytes but stack used by function > arguments are larger than 16 bytes. We should remove noinline_for_stack ? My recollection is that

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Tetsuo Handa
Andrew Morton wrote: > > This patch introduces %pT format specifier for printing task_struct->comm. > > Currently %pT does not provide consistency. I'm planning to change to use > > RCU > > in the future. By using RCU, the comm name read from task_struct->comm will > > be > > guaranteed to be con

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Andrew Morton
On Sat, 11 Jan 2014 10:28:51 +0900 Tetsuo Handa wrote: > Andrew Morton wrote: > > On Thu, 9 Jan 2014 21:52:00 +0900 Tetsuo Handa > > wrote: > > > > > This patch introduces %pT format specifier for printing task_struct->comm. > > > Currently %pT does not provide consistency. I'm planning to ch

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Tetsuo Handa
Joe Perches wrote: > On Sat, 2014-01-11 at 10:28 +0900, Tetsuo Handa wrote: > > Step 1: (targeted to 3.14-rc1) > > Add "%pT" format specifier and commcpy() wrapper function. > > > > Step 2: (started after step 1 is reflected to other git trees) > > Replace printk("%s", p->comm) with pr

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Joe Perches
On Sat, 2014-01-11 at 10:28 +0900, Tetsuo Handa wrote: > Step 1: (targeted to 3.14-rc1) > Add "%pT" format specifier and commcpy() wrapper function. > > Step 2: (started after step 1 is reflected to other git trees) > Replace printk("%s", p->comm) with printk("%pT", p). Replace printk

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Tetsuo Handa
Andrew Morton wrote: > On Thu, 9 Jan 2014 21:52:00 +0900 Tetsuo Handa > wrote: > > > This patch introduces %pT format specifier for printing task_struct->comm. > > Currently %pT does not provide consistency. I'm planning to change to use > > RCU > > in the future. By using RCU, the comm name re

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Andrew Morton
On Thu, 9 Jan 2014 21:52:00 +0900 Tetsuo Handa wrote: > This patch introduces %pT format specifier for printing task_struct->comm. > Currently %pT does not provide consistency. I'm planning to change to use RCU > in the future. By using RCU, the comm name read from task_struct->comm will be > gu

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-10 Thread Andrew Morton
190593d9e78f5d67de8 Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Thu, 9 Jan 2014 21:32:22 +0900 > Subject: [PATCH] lib/vsprintf: add %pT format specifier > > Since task_struct->comm can be modified by other threads while the current > thread is reading it

Re: [PATCH] lib/vsprintf: add %pT format specifier

2014-01-09 Thread Kees Cook
aders. Looks good; thanks for chasing this. :) > > Regards. > > >From 0d1f03d59a477459f3d3c190593d9e78f5d67de8 Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Thu, 9 Jan 2014 21:32:22 +0900 > Subject: [PATCH] lib/vsprintf: add

[PATCH] lib/vsprintf: add %pT format specifier

2014-01-09 Thread Tetsuo Handa
t;From 0d1f03d59a477459f3d3c190593d9e78f5d67de8 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Thu, 9 Jan 2014 21:32:22 +0900 Subject: [PATCH] lib/vsprintf: add %pT format specifier Since task_struct->comm can be modified by other threads while the current thread is reading it, it is recommended to use get_