From 69a961ffd9b098b719afe53c90a63a59b367aaea Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 6 Nov 2010 10:29:41 +0100 Subject: open_issues/performance/fork: New. --- open_issues/performance/fork.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 open_issues/performance/fork.mdwn (limited to 'open_issues/performance/fork.mdwn') diff --git a/open_issues/performance/fork.mdwn b/open_issues/performance/fork.mdwn new file mode 100644 index 00000000..250b5277 --- /dev/null +++ b/open_issues/performance/fork.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!tag open_issue_glibc open_issue_hurd]] + +On Unix systems, `fork` is a rather simple system call. Our implementation in +[[glibc]] is / needs to be rather bulky. TODO: elaborate. + +This affects performance when new processes are continuously being spawned from +the shell, for example. + +Alternatives: use `posix_spawn`. Others? + +To do: hard numbers. -- cgit v1.2.3 From 1aaf9868f2b9c50c3c60cc9040e0b5c94dbe2b87 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 12 Nov 2010 12:09:07 +0100 Subject: open_issues/performance/microbenchmarks: New. --- open_issues/performance/fork.mdwn | 1 + open_issues/performance/microbenchmarks.mdwn | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 open_issues/performance/microbenchmarks.mdwn (limited to 'open_issues/performance/fork.mdwn') diff --git a/open_issues/performance/fork.mdwn b/open_issues/performance/fork.mdwn index 250b5277..390f6b99 100644 --- a/open_issues/performance/fork.mdwn +++ b/open_issues/performance/fork.mdwn @@ -19,3 +19,4 @@ the shell, for example. Alternatives: use `posix_spawn`. Others? To do: hard numbers. +[[Microbenchmarks]]? diff --git a/open_issues/performance/microbenchmarks.mdwn b/open_issues/performance/microbenchmarks.mdwn new file mode 100644 index 00000000..de3a54b7 --- /dev/null +++ b/open_issues/performance/microbenchmarks.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +Microbenchmarks may give useful hints, or they may not. + + -- cgit v1.2.3 From e90db4db98bf65bd354994a7496b6b4e534e3f32 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 26 Nov 2010 09:33:49 +0100 Subject: glibc/fork: New. --- glibc/fork.mdwn | 41 +++++++++++++++++++++++++++++++++++++++ open_issues/performance/fork.mdwn | 8 +------- 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 glibc/fork.mdwn (limited to 'open_issues/performance/fork.mdwn') diff --git a/glibc/fork.mdwn b/glibc/fork.mdwn new file mode 100644 index 00000000..d1b26906 --- /dev/null +++ b/glibc/fork.mdwn @@ -0,0 +1,41 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +On [[Unix]] systems, `fork` is a rather simple system call. + +Our implementation in [[glibc]] is and needs to be rather bulky. + +For example, it has to duplicate all port rights for the new [[Mach +task|microkernel/mach/task]]. The address space can simply be duplicated by +standard means of the [[microkernel/Mach]], but as [[file descriptor]]s (for +example) are a concept that is implemented inside [[glibc]] (based on [[Mach +port|microkernel/mach/port]]s), these have to be duplicated from userspace, +which requires a small number of [[RPC]] for each of them. + +In sum, [[this affects performance|open_issues/performance/fork]] when new +processes are continuously being spawned from the shell, for example. + +Often, a `fork` call will eventually be followed by an `exec`, which will in +turn close (most of) the duplicated port rights. Unfortunately, this cannot be +known at the time the `fork` executing, so the code calling `fork` has to be +modified, and the `fork`, `exec` combo be replaced by a `posix_spawn` call, for +example, to avoid this work of duplicating each port right, then closing each +again. + +As far as we know, Cygwin has the same problem of `fork` being a nontrivial +operation. Perhaps we can learn from what they're been doing? Also, perhaps +they have patches for software packages, to avoid using `fork` followed by +`exec`, for example. + +--- + +We no longer support `MACH_IPC_COMPAT`, thus we can get rid of the `err = +__mach_port_allocate_name ([...]); if (err == KERN_NAME_EXISTS)` code[[!tag +open_issue_glibc]]. diff --git a/open_issues/performance/fork.mdwn b/open_issues/performance/fork.mdwn index 390f6b99..2748be53 100644 --- a/open_issues/performance/fork.mdwn +++ b/open_issues/performance/fork.mdwn @@ -10,13 +10,7 @@ License|/fdl]]."]]"""]] [[!tag open_issue_glibc open_issue_hurd]] -On Unix systems, `fork` is a rather simple system call. Our implementation in -[[glibc]] is / needs to be rather bulky. TODO: elaborate. - -This affects performance when new processes are continuously being spawned from -the shell, for example. - -Alternatives: use `posix_spawn`. Others? +Our [[`fork` implementation|glibc/fork]] is nontrivial. To do: hard numbers. [[Microbenchmarks]]? -- cgit v1.2.3