[PATCH 7/15] Helpers to obtain pid numbers

Pavel Emelyanov xemul at openvz.org
Thu Jul 26 23:40:47 PDT 2007


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_<what> for the lower-level namespace?

> 
> -- Dave
> 
> 

Thanks,
Pavel


More information about the Containers mailing list