From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH 1/1] proc: make /proc/self point to thread Date: Tue, 27 Aug 2013 11:15:56 -0700 Message-ID: References: <20130825194844.GA16717@redhat.com> <20130826153301.GA15890@redhat.com> <20130826163704.GA21763@redhat.com> <20130826175441.GA28856@redhat.com> <20130827143938.GA19425@redhat.com> <20130827144004.GB19425@redhat.com> <20130827174916.GA802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Andrew Morton , "Eric W. Biederman" , Willy Tarreau , Al Viro , Andy Lutomirski , Ingo Molnar , Linux Kernel Mailing List , Linux FS Devel , Brad Spengler To: Oleg Nesterov Return-path: In-Reply-To: <20130827174916.GA802@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Aug 27, 2013 at 10:49 AM, Oleg Nesterov 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// and get the expected result, but if you do ls -l /proc | grep 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