Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2012 18:48:13 +0000 (UTC)
From:      jb <jb.1234abcd@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD vice OS X memory management
Message-ID:  <loom.20120425T202502-789@post.gmane.org>
References:  <loom.20120425T142751-217@post.gmane.org> <2FCC4ECF-DAC2-4701-B392-B0415528A4C7@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Swiger <cswiger <at> mac.com> writes:

> 
> On Apr 25, 2012, at 5:31 AM, jb wrote:
> > does OS X kernel share any code with FreeBSD kernel's memory management
subsystem ?
> 
> The simple answer is no.  A more complex answer:
> 
> % grep -ri freebsd xnu-1699.24.23 | wc -l
>      520
> 
> % grep -ril freebsd xnu-1699.24.23 | sort | uniq
> 
> 
> 
> % grep -ril freebsd xnu-1699.24.23 | sort | uniq
> ~/Downloads
> xnu-1699.24.23/EXTERNAL_HEADERS/stdbool.h
> xnu-1699.24.23/bsd/bsm/audit.h
> ...

Right, MM subsys is not part of BSD import.
But XNU kernel is a combo of Mach and old BSD kernel parts.

There was some discussion here:
http://www.osnews.com/comments/25861
where two comments are of interest:

"I'm quite sure that the memory manager of OSX wasn't derived from BSD, but from
Mach. Actually, FreeBSD has adapted that memory manager, so it's rather the
other way around. But Apple might learn from the way FreeBSD does things. If it
is feasible, as the kernel is quite different."

"The related implementation in FreeBSD seems to have a similar problem:

NetBSD users have also reported that UVM’s im- provements have had a positive
effect on their applica- tions. This is most noticeable when physical memory
becomes scarce and the VM system must page out data to free up memory. Under BSD
VM this type of paging causes the system to become highly unresponsive, while
under UVM the system slows while paging but does not become unresponsive.
http://static.usenix.org/event/usenix99/full_papers/cranor/cranor.p...

Should be easy to fix: just start to page out some stuff in time before there is
no memory left."

When I browsed the USENIX paper (dated 1999) I understood that it is indeed
possible that FreeBSD may have imported some Mach's MM code in those early
BSD VM days.

And over time since then some ideas (if not exact code) may have migrated
between OS X and FreeBSD MM subsystems.

If so, the problems experienced may be similar or identical even today.

jb





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?loom.20120425T202502-789>