public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched.h: increment TASK_COMM_LEN to 20 bytes
@ 2006-07-01  1:06 Luben Tuikov
  2006-07-01  1:19 ` Andrew Morton
  0 siblings, 1 reply; 14+ messages in thread
From: Luben Tuikov @ 2006-07-01  1:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

It is 4 byte aligned anyway.  This way we can use
up to 19+1 chars.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 include/linux/sched.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 18f12cb..3fc11bc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -154,7 +154,7 @@ #define set_current_state(state_value)		
 	set_mb(current->state, (state_value))
 
 /* Task command name length */
-#define TASK_COMM_LEN 16
+#define TASK_COMM_LEN 20
 
 /*
  * Scheduling policies
-- 
1.4.1.rc2.g4ce4



^ permalink raw reply related	[flat|nested] 14+ messages in thread
* Re: [PATCH] sched.h: increment TASK_COMM_LEN to 20 bytes
@ 2006-06-24  2:27 Albert Cahalan
  0 siblings, 0 replies; 14+ messages in thread
From: Albert Cahalan @ 2006-06-24  2:27 UTC (permalink / raw)
  To: linux-kernel, ltuikov

Luben Tuikov writes:

> Lets use 19+1 chars.  This helps display properly
> kernel threads (e.g. SATA translation threads) which bear
> the address of the STP/SATA bridge where the SATA disk is
> connected. Those are 16+1 chars long.  Currently (15+1) the
> last character is not displayed as it is used by the '\0'.

This makes apps crash when they do this:

char buf[16];
prctl(PR_GET_NAME, buf, 42, 42, 42);

Check the last 15 lines of kernel/sys.c to see why.

Though none of my code breaks, I have to wonder about what might
be out there. (my code truncates it)

I tend to think that putting 64 bits of hex in the command name
is an abuse of the command name. Perhaps it is time to make argv
work for built-in kernel tasks. It's also long past time to group
these things by tgid, reducing the horrible clutter seen on
large systems.

As for the size chosen...

Solaris uses 15. (plus 80 for unswappable argv)
Darwin uses 16. (was 10 I believe)
OpenBSD uses 16.
NetBSD uses 16.
We use 15. (you propose 19)
FreeBSD uses 19.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] sched.h: increment TASK_COMM_LEN to 20 bytes
@ 2006-06-23 16:49 Luben Tuikov
  0 siblings, 0 replies; 14+ messages in thread
From: Luben Tuikov @ 2006-06-23 16:49 UTC (permalink / raw)
  To: linux-kernel

Lets use 19+1 chars.  This helps display properly
kernel threads (e.g. SATA translation threads) which bear
the address of the STP/SATA bridge where the SATA disk is
connected. Those are 16+1 chars long.  Currently (15+1) the last
character is not displayed as it is used by the '\0'.

The array is 4 byte aligned so we add another 4 bytes to it.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 include/linux/sched.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 18f12cb..3fc11bc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -154,7 +154,7 @@ #define set_current_state(state_value)
        set_mb(current->state, (state_value))
 
 /* Task command name length */
-#define TASK_COMM_LEN 16
+#define TASK_COMM_LEN 20
 
 /*
  * Scheduling policies
-- 
1.4.0.g470d



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-07-09  0:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-01  1:06 [PATCH] sched.h: increment TASK_COMM_LEN to 20 bytes Luben Tuikov
2006-07-01  1:19 ` Andrew Morton
2006-07-01  1:26   ` Luben Tuikov
2006-07-01  1:37     ` Andrew Morton
2006-07-01  2:48       ` Luben Tuikov
2006-07-01  4:46       ` Jeff Garzik
2006-07-01  4:53         ` Andrew Morton
2006-07-07 17:00           ` Luben Tuikov
2006-07-07 17:10             ` Jeff Garzik
2006-07-09  0:48               ` Luben Tuikov
2006-07-01  9:01       ` Jan Engelhardt
2006-07-03 12:07   ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2006-06-24  2:27 Albert Cahalan
2006-06-23 16:49 Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox