From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 7/15] Helpers to obtain pid numbers Date: Fri, 27 Jul 2007 10:40:47 +0400 Message-ID: <46A9936F.6040309@openvz.org> References: <46A8B37B.6050108@openvz.org> <46A8B4D6.1080301@openvz.org> <1185476582.18414.114.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1185476582.18414.114.camel@localhost> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Dave Hansen Cc: Linux Containers , Oleg Nesterov List-Id: containers.vger.kernel.org Dave Hansen wrote: > On Thu, 2007-07-26 at 18:51 +0400, Pavel Emelyanov wrote: >> + * pid_nr() : global id, i.e. the id seen from the init namespace; >> + * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid >> + * belongs to. this only makes sence when called in the >> + * context of the task that belongs to the same namespace; > > Can we give these some better names? I think "virtual" is pretty bad, > especially if you consider the multiple level of pid namespaces that we > might have some day. Processes can belong to multiple pid namespaces, > and thus have multiple "virtual" ids. We do have them now (multiple levels). The "virtual" stands for "the one that task sees by his own". > Even though it will make the names longer, I think we need something in > the names to say that "pid_nr()" is the top-level, global, init_pid_ns > number. "pid_vnr()" is the pid for the lowest pid namespace in the > hierarchy. That's it. > Suka called this an "active pid namespace" because that is > where the task actively interacts with its peers. But, I'm open to > other suggestions, too. > > When writing code, people are going to need to know which one to use: > pid_nr() or pid_vnr(). We can document the functions, but the names > will help much more than any documentation. I do not mind, but what other names can we have? pid_nr() for init namespace, pid_nr_ns for arbitrary namespace and pid_ for the lower-level namespace? > > -- Dave > > Thanks, Pavel