public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Richter <Simon.Richter@hogyros.de>
To: Mark Rustad <mrustad@mac.com>
Cc: Linux-Kernel mailing-list <linux-kernel@vger.kernel.org>
Subject: Re: RFC: implement daemon() in the kernel
Date: Mon, 20 Nov 2006 18:42:59 +0100	[thread overview]
Message-ID: <4561E923.3080305@hogyros.de> (raw)
In-Reply-To: <33832325-EF32-4C6D-B566-8B7CE179FF1C@mac.com>

Hi,

Mark Rustad schrieb:

> There is a better way. Simply implement fork(). It can be done even 
> without an MMU. People think it is impossible, but that is only because 
> they don't consider the possibility of copying memory back and forth on 
> task switch. It sounds horrible, but in the vast majority of cases, 
> either the parent or child either exits or does an exec pretty quickly, 
> so in reality it doesn't cost much. The benefits are many: being able to 
> use real shells such as bash and thereby being able to use real shell 
> scripts.

This imposes quite a significant overhead for the common case (in which 
the application has specifically requested that the parent process be 
terminated after the child process is fork()ed off). Even if the cost of 
transferring memory contents was cheap (which it isn't), you'd annoy the 
memory management subsystem unless you did a lot of weird tricks to 
avoid allocating from a large block.

> You do have to look out for any applications that fork and do not either 
> exit or exec, but that is so much better than having to modify so many 
> things just to get them to run.

Well, in fact just having a libc that does not define a symbol for 
"fork" and then going to the places the linker mentions as having 
undefined references is a pretty easy way. Mind you, in 90% of cases you 
can replace them by a vfork() and be done.

    Simon

  reply	other threads:[~2006-11-20 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 13:20 RFC: implement daemon() in the kernel Simon Richter
2006-11-20 15:38 ` Mark Rustad
2006-11-20 17:42   ` Simon Richter [this message]
2006-11-20 20:48     ` Mark Rustad
2006-11-20 20:38 ` Jan Engelhardt
2006-11-21  0:38 ` H. Peter Anvin
2006-11-21  9:30   ` Michal Schmidt
2006-11-21 17:15     ` H. Peter Anvin

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=4561E923.3080305@hogyros.de \
    --to=simon.richter@hogyros.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrustad@mac.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox