lkml.org 
[lkml]   [2011]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/4] v6 Improve task->comm locking situation

* Andrew Morton <akpm@linux-foundation.org> wrote:

> On Wed, 18 May 2011 08:25:54 +0200 Ingo Molnar <mingo@elte.hu> wrote:
>
> > " Hey, this looks a bit racy and 'top' very rarely, on rare workloads that
> > play with ->comm[], might display a weird reading task name for a second,
> > amongst the many other temporarily nonsensical statistical things it
> > already prints every now and then. "
>
> Well we should at least make sure that `top' won't run off the end of comm[]
> and go oops. I think that's guaranteed by the fact(s) that init_tasks's
> comm[15] is zero and is always copied-by-value across fork and can never be
> overwritten in any task_struct.

Correct.

> But I didn't check that.

I actually have a highly threaded app that uses PR_SET_NAME heavily and would
have noticed any oopsing potential long ago.

Since ->comm is often observed from other tasks, regardless whether it's set
from the prctl() or from the newfangled /proc vector, the race for seeing
partial updates to ->comm always existed - for more than 10 years.

So the premise of the whole series is wrong: temporarily incomplete ->comm[]s
were *always* possible and did not start 1.5+ years ago with:

4614a696bd1c: procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm

when i see series being built on a fundamentally wrong premise i get a bit sad!

Thanks,

Ingo


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