lkml.org 
[lkml]   [2011]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/3] v4 Improve task->comm locking situation
(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.






\
 
 \ /
  Last update: 2011-05-18 06:13    [W:0.229 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site