lkml.org 
[lkml]   [2011]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] export kernel call get_task_comm().
On Wed, 20 Apr 2011, Andrew Morton wrote:

> > > But as David pointed out, if there is work other than mine coming that
> > > has already been proposed, wouldn't it be good to get this patch in
> > > place now to start the encouragement of future eyes to just call this
> > > function than re-invent the wheel?
> >
> > No, then those projects submit the patch to export this, if they happen
> > to get to mainline before this one does.
> >
> > Again, don't export something unless you are using it at the time, no
> > "this is to be used hopefully by something in the future" type stuff
> > please. Who knows if those future plans ever pan out.
>
> Well there's an easy solution here. Send the patch to export
> get_task_comm(), then send along some patches which fix
>
> z:/usr/src/linux-2.6.39-rc4> grep -r 'current->comm' drivers | wc -l
> 89
>

If we go this route and continue to support /proc/pid/comm, then we're
going to need to ensure nothing that dereferences p->comm for any thread p
is in a blockable context and that it's acceptable for get_task_comm(p) to
take task_lock(p), and that requires not nesting it with
write_lock(&tasklist_lock).

I'm thinking that we're going to want to choose something else other than
p->alloc_lock to protect p->comm since that lock is protecting so many
different members of struct task_struct that we may not know whether it's
held when we want to print p->comm.


\
 
 \ /
  Last update: 2011-04-21 01:21    [W:0.090 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site