lkml.org 
[lkml]   [1997]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Memory Management - BSD vs Linux
   From: "Douglas Jardine" <djardine@hotmail.com>
Date: Sun, 10 Aug 1997 08:11:12 PDT

[1] FreeBSD uses a "Zone allocator" for kernel memory allocation.
NetBSD - I am not so sure.
Linux - Buddy system.

The SLAB allocator. (See the Bonwick '94 paper, published in the 1994 Boston
Usenix proceedings).

[2] All of FreeBSD/NetBSD/Linux are demand paged. They all have a
memory overcommit architectures and swap if required. All can
have multiple swap partions.

Yes.

[3] Can any of these systems have
a) swap files rather than partitions
b) dynamically growing swap space?
As far as I can make out, the answeris no!

Linux can swap to files (multiple files if necessary), and there is a
user-mode daemon that can allow you to dyanmically grow swap space (by
allocating a new file).

[4] FreeBSD/NetBSD swap out complete processes when required.
Linux swaps out only some pages per process, upto the complete
process if required.

True.

[5] All of FreeBSD/NetBSD/Linux write out only the dirty pages to
swap space, choosing to read in the read-only (code) pages from
the file system.

Is this true of FreeBSD/NetBSD? It wasn't true of BSD 4.3; I don't know
about BSD 4.4

[6] In FreeBSD, the file system buffer cache is implemented on top of
the the memory management system using objects from the VM system
to compose the buffer cache.
NetBSD has separate fixed allocation of physical memory for the
buffer cache which is not available to the VM system.
Linux has a separate buffer cache like NetBSD, but the
buffer cache size is not fixed and can vary dynamically depending
on load (? not sure about this)

Linux was in fact the first of the free Unix systems to support a
combined (integrated) VM and buffer cache.

Even back in the olden days, before Linux 1.0 (0.97; roughly August
1992, the pre-Linux 1.0 code used the same memory pool for the buffer
cache and VM pages, although an executable page still needed to be
copied from the buffer cache to a VM page. This allowed for dynamic
adjustment between the memory used for the buffer cache and for VM
objects.

In current kernels (in at least the Linux 2.0 kernel; I'm not sure if
this was in the Linux 1.2 kernel), executable, mmap'ed and even data
pages are read directly into a page cache, avoiding the needless copy
and the extra memory wasted in the older system. The buffer cache is
still present for filesystem meta-data and as a simple standard
interface for the block device drivers; however, the VM system makes
"fake" buffer heads which are used to cause the block device drivers to
read and write directly in and out of the page cache for all
data/executable I/O.

- Ted

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.089 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site