Re: anyone understand torvald's critique of freebsd?



Peter wrote:
Does anyone here understand Linus Torvald's recent comments on FreeBSD?

http://bsdnews.com/view_story.php3?story_id=5735

Sure. There are different ways of moving data between the kernel and userland; the classic mechanism involves copying data from a wired-down page in kernel space allocated to network memory buffers to a userland page via copyin() and copyout() (or equivalents).

Mach (and apparently the ZERO_COPY_SOCKETS option to FreeBSD) manipulate the VM page table mappings to make that page visible in the process address space rather than copying the sequence of bytes manually via a message-passing paradigm.

The former approach tends to be more efficient for small amounts of data, especially for things smaller than one page of memory (ie, all non-jumbo network traffic); the latter approach tends to better for things which are bigger in size.

The Mach VM has more overhead to its operations because the VMOs are more complicated to work and a given workload will result in comparatively larger VMO datastructures than the less-complicated approaches to doing VM. On the other hand, Mach was the first or among the earliest platforms to support shared libraries, dynamic loading of objects into user processes (dlopen vs. dso) and into the kernel, and has somewhat better scaling in the face of gigabytes of RAM and VM usage than most Unix flavors do (outside of Solaris, although FreeBSD is pretty decent nowadays too).

Mach handles mapping shared libraries into VM via a technique called prebinding that can minimize the work and memory overhead required for runtime symbol relocation, which tends to big win if you are running a lot of, say, Java or Perl processes that make extensive use of runtime class-loading, yet is flexible enough to deal with collisions if needed (whereas the older fixed-VM shared libraries were subject to evil nasty conflicts if your data segment grew too big and overlapped a library's chosen address space, or if two libraries wanted to be mapped into the same spot).

--
-Chuck
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Can a process start threads with individual user rights?
    ... I want to offer programming tools to a small group of ... UML wastes way too much memory). ... communicates with the web server program. ... Especially when you're allowing shared libraries rather than just "sandbox-able" interpreted code. ...
    (comp.programming.threads)
  • Bio & Biovec-1 increasing cache size, never freed during disk IO
    ... high disk IO (copying a lot of data between 2 machines): ... memory get filled up, until the full swap is used and the system must ... mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext ...
    (Linux-Kernel)
  • Re: rep stosb
    ... its for fast software blitting on a video game on a coldfire with cremson gd videocard. ... Suppose I have a bitmap compressed in memory and it has to be realtime decompressed and blitted to the screen. ... If you are decompressing the data into a local buffer, and then copying it over to the screen, then try to use internal memory for the local buffer, and have the DMA copying going on in parallel with the processor's decoding. ... If you want to work harder at it, consider pretending the data is floating point so that you work with 64-bit data per transfer, rather than 32-bit. ...
    (comp.sys.m68k)
  • Re: Vista runs out of memory while copying files
    ... fails to complete the copying due to lack of memory. ... Unfortunatly, that bug just ... so Vista users must ask for a hotfix on that ... In fact, I have done specific testing copying files back and forth, ...
    (comp.sys.mac.advocacy)
  • Re: malloc does not return null when out of memory
    ... Peter Jeremy wrote: ... very familar with the Mach project, Mach memory management, and task/thread ... Mach relies heavily on COW semantics and lazy allocation of resources, ...
    (freebsd-stable)