git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Change set based shallow clone

From
Llinux@horizon.com <linux@horizon.com>
Date
Sep 10, 2006, 16:10 UTC
Message-ID
<20060910161007.8846.qmail@science.horizon.com>
In-Reply-To
<9e4733910609100756r1ece1e22m38054536a2909dd4@mail.gmail.com>
Show 8 quoted lines
> You noticed too that forks of small apps are relatively slow. The
> first pass of the import tools used fork for everything and took a
> week to run with 60% of the time spent in the kernel. There may be
> some work to do on fork in the kernel. Does mapping the kernel into
> the top 1G slow down fork of these small apps? Or are they dynamically
> linked to something that is bringing in millions of pages? When I was
> doing oprofile all of the time was in the actual fork call and page
> table copying.

Actually, Linux has one of the fastest forks around, 100-200 us on modern x86. For large executables, the shared page tables patch (is it merged yet?) might help.

No, mapping the kernel does NOT slow anything down. Those page tables are shared between all processes, and use the x86's global bit to avoid being forced out of the TLB during context switch. Attempting to make the kernel mapping vary between processes would slow things down enormously!

I'm not finding reasonably recent Linux/FreeBSD comparisons.  There are
plenty of Max OS X comparisons, but it appears to particularly suck,
so that's a bit of a straw man.  See, e.g.
http://www.anandtech.com/mac/showdoc.aspx?i=2520&p=7
or some figures from 2002:
http://lists.apple.com/archives/darwin-kernel/2002/Oct/msg00009.html
----------------------------------------------------------------
Host      OS            Mhz  null null      open selct sig  sig  fork exec sh
                             call I/O  stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
g4           Darwin 1.4  799 2.21 3.19 12.6 16.4 30.4  3.78 9.88 1576 4095 13.K
g4           Darwin 5.5  797 2.26 3.15 14.5 17.8 30.4  3.82 10.2 5685 12.K 40.K
g4.local.    Darwin 6.0  797 1.47 2.73 17.2 20.7 27.2  3.00 10.5 7517 17.K 41.K
g4.local.    Darwin 6.0  (after misconfiguration fixed)          1575
g4        Linux 2.4.18-  799 0.42 0.69 2.52 3.79 33.6  1.23 3.08 659. 2642 12.K
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
jim          Darwin 1.4  448 2.85 4.23 9.53   17       4.83   14 2402 6817  19K
jim.local    Darwin 6.1  448 1.89 3.71   21   29    43 3.85   15 2832 8955  19K

For small processes such as lmbench uses, you can see from the above that exec is much more expensive than fork. Also http://www.opersys.com/lrtbf/index.html http://marc.theaimsgroup.com/?l=linux-kernel&m=112086443319815 http://www.opensourcetutorials.com/tutorials/Server-Side-Coding/Administration/hyper-threading-linux/page4.html

As for small apps and dynamic linking, glibc isn't tiny (prelink can help), but that's post-exec. If it's in the fork() call, then it's just a case that your app's memory space is big and even copying all of its page tables is expensive.

If you're invoking one of the git programs that's a shell script, that adds its own startup overhead, of course.

Previous: Jon SmirlNext: Jon Smirl
Message 36 of 99 in “Change set based shallow clone”
  1. Jon SmirlSep 7, 2006
  2. Jakub NarebskiSep 7, 2006
  3. Jon SmirlSep 7, 2006
  4. Jeff KingSep 7, 2006
  5. Jakub NarebskiSep 7, 2006
  6. Jakub NarebskiSep 7, 2006
  7. Junio C HamanoSep 7, 2006
  8. Jon SmirlSep 7, 2006
  9. Anand KumriaSep 10, 2006
  10. Andreas EricssonSep 8, 2006
  11. Junio C HamanoSep 7, 2006
  12. Jakub NarebskiSep 7, 2006
  13. Martin LanghoffSep 8, 2006
  14. Junio C HamanoSep 8, 2006
  15. Martin LanghoffSep 8, 2006
  16. Junio C HamanoSep 8, 2006
  17. A Large Angry SCMSep 8, 2006
  18. Jon SmirlSep 8, 2006
  19. Jakub NarebskiSep 8, 2006
  20. Petr BaudisSep 9, 2006
  21. Jakub NarebskiSep 9, 2006
  22. Aneesh Kumar K.VSep 8, 2006
  23. linux@horizon.comSep 8, 2006
  24. Jon SmirlSep 8, 2006
  25. Jakub NarebskiSep 8, 2006
  26. Junio C HamanoSep 8, 2006
  27. linux@horizon.comSep 8, 2006
  28. Jon SmirlSep 8, 2006
  29. Jakub NarebskiSep 8, 2006
  30. Linus TorvaldsSep 8, 2006
  31. Jon SmirlSep 8, 2006
  32. Paul MackerrasSep 8, 2006
  33. Jon SmirlSep 9, 2006
  34. Paul MackerrasSep 10, 2006
  35. Jon SmirlSep 10, 2006
  36. linux@horizon.comSep 10, 2006
  37. Jon SmirlSep 10, 2006
  38. linux@horizon.comSep 10, 2006
  39. Linus TorvaldsSep 10, 2006
  40. Jon SmirlSep 10, 2006
  41. Linus TorvaldsSep 11, 2006
  42. Paul MackerrasSep 10, 2006
  43. Linus TorvaldsSep 11, 2006
  44. Linus TorvaldsSep 11, 2006
  45. Junio C HamanoSep 11, 2006
  46. Junio C HamanoSep 11, 2006
  47. Paul MackerrasSep 11, 2006
  48. linux@horizon.comSep 11, 2006
  49. Jon SmirlSep 11, 2006
  50. Junio C HamanoSep 11, 2006
  51. Paul MackerrasSep 11, 2006
  52. Junio C HamanoSep 11, 2006
  53. Jakub NarebskiSep 12, 2006
  54. Junio C HamanoSep 12, 2006
  55. Jakub NarebskiSep 12, 2006
  56. Jakub NarebskiSep 11, 2006
  57. Junio C HamanoSep 10, 2006
  58. Shawn PearceSep 11, 2006
  59. Junio C HamanoSep 11, 2006
  60. Shawn PearceSep 11, 2006
  61. Junio C HamanoSep 11, 2006
  62. Jakub NarebskiSep 11, 2006
  63. Shawn PearceSep 11, 2006
  64. Junio C HamanoSep 11, 2006
  65. Shawn PearceSep 11, 2006
  66. Junio C HamanoSep 11, 2006
  67. Shawn PearceSep 11, 2006
  68. Jon SmirlSep 11, 2006
  69. Paul MackerrasSep 9, 2006
  70. Linus TorvaldsSep 9, 2006
  71. Junio C HamanoSep 9, 2006
  72. Paul MackerrasSep 9, 2006
  73. Linus TorvaldsSep 9, 2006
  74. Marco CostalbaSep 9, 2006
  75. Linus TorvaldsSep 9, 2006
  76. Marco CostalbaSep 9, 2006
  77. linux@horizon.comSep 9, 2006
  78. Marco CostalbaSep 9, 2006
  79. Linus TorvaldsSep 9, 2006
  80. Jeff KingSep 9, 2006
  81. Junio C HamanoSep 9, 2006
  82. Jeff KingSep 9, 2006
  83. Linus TorvaldsSep 9, 2006
  84. Jon SmirlSep 9, 2006
  85. Linus TorvaldsSep 10, 2006
  86. Junio C HamanoSep 10, 2006
  87. Marco CostalbaSep 10, 2006
  88. Junio C HamanoSep 10, 2006
  89. Marco CostalbaSep 10, 2006
  90. Marco CostalbaSep 10, 2006
  91. Junio C HamanoSep 10, 2006
  92. Marco CostalbaSep 10, 2006
  93. Junio C HamanoSep 10, 2006
  94. linux@horizon.comSep 10, 2006
  95. Marco CostalbaSep 10, 2006
  96. Paul MackerrasSep 11, 2006
  97. linux@horizon.comSep 11, 2006
  98. Jakub NarebskiSep 10, 2006
  99. Josef WeidendorferSep 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.