linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Cc: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Nathan Lynch <nathanl-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Eric W. Biederman"
	<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
	kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
	mingo-X9Un+BFzKDI@public.gmane.org,
	Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	Alexey Dobriyan
	<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Arjan van de Ven <arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: Re: [RFC][v7][PATCH 8/9]: Define clone2() syscall
Date: Tue, 29 Sep 2009 15:11:03 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0909291501530.6996@localhost.localdomain> (raw)
In-Reply-To: <4AC267C7.4070300-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>



On Tue, 29 Sep 2009, H. Peter Anvin wrote:
> 
> That's not the main issue here, though.  The main issue is that the
> prototype of the function now depends on one of its arguments

Ok, I agree with that. The kernel side is easy (we have magic calling 
conventions there and need to turn registers into arguments anyway before 
you get to the shared code), but your point about the user side prototype 
is valid.

However, that could easily be handled by just having a extended_clone() 
prototype that then sets the CLONE_EXTINFO (or whatever) bit in the flags. 
I think most of the time the clone() stuff needs special user-level 
wrappers anyway to handle the stack setup etc, no?

In other words, what I'd suggest we could do is

 - the kernel "do_fork()" interface would be made to have the "extended" 
   format by default - so the _kernel_ never has two formats in its 
   generic logic.

 - the "sys_clone()" system call, that already needs to munge the user 
   mode registers into the "do_fork()" format, would be the one that 
   recognizes the new flag and copies the extended data from user mode 
   memory to the extended info mode.

Then each architecture would need to update it's "sys_clone()" function to 
take advantage of the new extended format, but that's something that the 
new system call would have had to do anyway, so that's not an added burden 
in any way.

Hmm?

I don't feel horribly strongly about this, and as far as I'm concerned 
it's fine to also do it as a new system call too (we already have 'fork()' 
and 'vfork()' as special case interfaces to do_fork() - the new 'extended 
clone' would be no different).

I just think that Roland is correct that if the new extended fork handles 
the "no new info" case itself _anyway_, then there is no upside to making 
it a new system call, since the complexity is the same as just extending 
the old one.

			Linus

  parent reply	other threads:[~2009-09-29 22:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090924165548.GA16586@us.ibm.com>
     [not found] ` <20090924170308.GH16989@us.ibm.com>
     [not found]   ` <200909242343.59903.arnd@arndb.de>
     [not found]     ` <20090925082346.GB4436@localdomain>
     [not found]       ` <20090925105632.GG12824@hawkmoon.kerlabs.com>
     [not found]         ` <20090925105632.GG12824-Hu8+6S1rdjywhHL9vcZdMVaTQe2KTcn/@public.gmane.org>
2009-09-29 18:05           ` [RFC][v7][PATCH 8/9]: Define clone2() syscall Sukadev Bhattiprolu
     [not found]             ` <20090929180537.GD4625-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-09-29 18:40               ` Roland McGrath
     [not found]                 ` <20090929184023.532DF34-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
2009-09-29 18:44                   ` H. Peter Anvin
     [not found]                     ` <4AC255A4.4030002-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-09-29 19:02                       ` Arjan van de Ven
     [not found]                         ` <20090929210207.247b94df-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-09-29 19:10                           ` Linus Torvalds
     [not found]                             ` <alpine.LFD.2.01.0909291207410.6996-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-09-29 20:02                               ` H. Peter Anvin
     [not found]                                 ` <4AC267C7.4070300-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-09-29 22:11                                   ` Linus Torvalds [this message]
     [not found]                                     ` <alpine.LFD.2.01.0909291501530.6996-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-09-29 22:19                                       ` H. Peter Anvin
     [not found]                                         ` <4AC287F2.8060603-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-09-30 16:15                                           ` Arnd Bergmann
     [not found]                                             ` <200909301815.45211.arnd-r2nGTMty4D4@public.gmane.org>
2009-09-30 16:27                                               ` Linus Torvalds
     [not found]                                                 ` <alpine.LFD.2.01.0909300925170.6996-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-09-30 17:59                                                   ` Arnd Bergmann
     [not found]                                                     ` <200909301959.41706.arnd-r2nGTMty4D4@public.gmane.org>
2009-09-30 19:14                                                       ` Linus Torvalds
2009-09-30  6:48                                       ` Roland McGrath
2009-09-29 20:00                         ` H. Peter Anvin
2009-09-29 21:58               ` Oren Laadan

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=alpine.LFD.2.01.0909291501530.6996@localhost.localdomain \
    --to=torvalds-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
    --cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
    --cc=kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=nathanl-V7BBcbaFuwjMbYB6QlFGEg@public.gmane.org \
    --cc=roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=xemul-GEFAQzZX7r8dnm+yROfE0A@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;
as well as URLs for NNTP newsgroup(s).