Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH] Add a choosepid() syscall as a simpler alternative to clone_with_pids()
Date: Tue, 03 Nov 2009 10:44:41 -0500	[thread overview]
Message-ID: <4AF04FE9.6090301@librato.com> (raw)
In-Reply-To: <1257194293-12099-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



Dan Smith wrote:
> This proposed simpler interface builds on all the real work done by Suka's
> early patches in his clone3() set.  Instead of passing in the pids we want
> in the clone3() call itself, this interface lets us build that list ahead
> of time, to be used on the next regular clone().
> 
> Some points about the implementation:
>  - The first call to choosepid() allocates a pid_t array on current
>  - All pids in that list start as zero, which do_fork_with_pids treats as
>    undefined
>  - A call to clone() or exec() always clears the current set of next pids
>  - This was Serge's idea, based on a permutation of Daniel Lezcano's
>    cloneat() suggestion
>  - This is based on all Suka's hard work, with a trivial change to the
>    do_fork_with_pids() function to eliminate the copy_from_user() of the
>    pid_t list
> 
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

I don't recall the details, but you probably wanna look at how/when
kernel threads are created and also at usermode helpers created from
the kernel (e.g. to load a module on-demand) - make sure they don't
intentionally (or not) consume the nextpid prepared by the program.

Oren.

  parent reply	other threads:[~2009-11-03 15:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 20:38 [PATCH] Add a choosepid() syscall as a simpler alternative to clone_with_pids() Dan Smith
     [not found] ` <1257194293-12099-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-11-02 20:48   ` Oren Laadan
     [not found]     ` <4AEF45BB.4080609-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-11-02 20:52       ` Dan Smith
     [not found]         ` <87ws281weu.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-11-02 21:02           ` Oren Laadan
2009-11-02 22:10       ` Serge E. Hallyn
2009-11-03 15:44   ` Oren Laadan [this message]
     [not found]     ` <4AF04FE9.6090301-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-11-03 21:43       ` Serge E. Hallyn

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=4AF04FE9.6090301@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox