lkml.org 
[lkml]   [2013]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] proc: make /proc/self point to thread
From
On Tue, Aug 27, 2013 at 10:49 AM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> Why? To me /proc/self == /proc/$((sys_gettid)) looks more natural.
> Say, /proc/self/task... But this is subjective.

Actually, you're right - I incorrectly thought we had removed the
thread id lookup from the top level in /proc. But we never actually
did that. We only removed them from readdir.

So while you won't see thread id's in the directory listing, we *do*
successfully look up thread id's when specified explicitly. It's
confusing, but it happens to work. So you can do

ls -l /proc/<tid>/

and get the expected result, but if you do

ls -l /proc | grep <tid>

it won't actually show up unless the thread ID is also the thread group leader.

> Although to be honest, I was seduced by "Worth testing". I mean I am
> just curious, who can suffer from this change? Nevermind, please
> ignore.

Yeah, if we were to redesign /proc I'd do it differently, but I think
we should just accept that it works "well enough" and there's just too
much risk from making changes that aren't strictly required.

Linus


\
 
 \ /
  Last update: 2013-08-27 20:21    [W:0.107 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site