All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@free.fr>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, ebiederm@xmission.com,
	oleg@redhat.com, containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, clg@fr.ibm.com
Subject: Re: [PATCH 4/4] pidns: Use task_active_pid_ns where appropriate
Date: Mon, 31 Jan 2011 15:47:58 +0100	[thread overview]
Message-ID: <4D46CB9E.1090802@free.fr> (raw)
In-Reply-To: <AANLkTikjcou-0b4NejpY66qXeZuzsC-M+oNTyHk=OE-Z@mail.gmail.com>

On 01/31/2011 12:26 PM, Alexey Dobriyan wrote:
> On Mon, Jan 31, 2011 at 12:25 PM, Daniel Lezcano<daniel.lezcano@free.fr>  wrote:
>> The expressions tsk->nsproxy->pid_ns and task_active_pid_ns
>> aka ns_of_pid(task_pid(tsk)) should have the same number of
>> cache line misses with the practical difference that
>> ns_of_pid(task_pid(tsk)) is released later in a processes life.
>>
>> Furthermore by using task_active_pid_ns it becomes trivial
>> to write an unshare implementation for the the pid namespace.
>>
>> So I have used task_active_pid_ns everywhere I can.
> Yet current->nsproxy->pid_ns is way clearer.
> Because live current always has pid_ns.
>
> This task_active_pid_ns() is misnamed(?) because it does matter only
> for dead tasks?

Actually this function is later used, for the unshare, to get the pid_ns 
of a specific task, not the current one.

http://kerneltrap.org/mailarchive/linux-kernel/2010/6/20/4585095

Do you suggest task_pid_ns(struct task_struct *tsk) would be a better name ?

>> -               current->nsproxy->pid_ns->last_pid);
>> +               task_active_pid_ns(current)->last_pid);
> I thought of doing exactly opposite patch :-)
>


  reply	other threads:[~2011-01-31 14:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 10:25 Prepare for the unshare support of the pid namespace Daniel Lezcano
2011-01-31 10:25 ` [PATCH 1/4] pid: Remove the child_reaper special case in init/main.c Daniel Lezcano
2011-01-31 10:25 ` [PATCH 2/4] pidns: Call pid_ns_prepare_proc from create_pid_namespace Daniel Lezcano
     [not found]   ` <1296469525-30111-3-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-01-31 13:22     ` Oleg Nesterov
2011-01-31 13:22   ` Oleg Nesterov
     [not found]     ` <20110131132207.GA26995-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-01-31 13:33       ` Daniel Lezcano
2011-01-31 13:33     ` Daniel Lezcano
     [not found]       ` <4D46BA25.8080201-GANU6spQydw@public.gmane.org>
2011-01-31 14:02         ` Oleg Nesterov
2011-01-31 14:02       ` Oleg Nesterov
2011-01-31 14:21         ` Daniel Lezcano
     [not found]         ` <20110131140257.GA28827-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-01-31 14:21           ` Daniel Lezcano
     [not found] ` <1296469525-30111-1-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-01-31 10:25   ` [PATCH 1/4] pid: Remove the child_reaper special case in init/main.c Daniel Lezcano
2011-01-31 10:25   ` [PATCH 2/4] pidns: Call pid_ns_prepare_proc from create_pid_namespace Daniel Lezcano
2011-01-31 10:25   ` [PATCH 3/4] procfs: kill the global proc_mnt variable Daniel Lezcano
2011-01-31 10:25   ` [PATCH 4/4] pidns: Use task_active_pid_ns where appropriate Daniel Lezcano
2011-01-31 10:25 ` [PATCH 3/4] procfs: kill the global proc_mnt variable Daniel Lezcano
2011-01-31 10:25 ` [PATCH 4/4] pidns: Use task_active_pid_ns where appropriate Daniel Lezcano
2011-01-31 11:26   ` Alexey Dobriyan
2011-01-31 14:47     ` Daniel Lezcano [this message]
2011-01-31 15:36       ` Oleg Nesterov
2011-02-01 10:07         ` Daniel Lezcano
     [not found]         ` <20110131153653.GA32392-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-02-01 10:07           ` Daniel Lezcano
     [not found]       ` <4D46CB9E.1090802-GANU6spQydw@public.gmane.org>
2011-01-31 15:36         ` Oleg Nesterov
     [not found]     ` <AANLkTikjcou-0b4NejpY66qXeZuzsC-M+oNTyHk=OE-Z-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-31 14:47       ` Daniel Lezcano
     [not found]   ` <1296469525-30111-5-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-01-31 11:26     ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D46CB9E.1090802@free.fr \
    --to=daniel.lezcano@free.fr \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=clg@fr.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.