28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

94<br />

Due to <strong>the</strong> design choice that a rump kernel does not use (nor require) a hardware<br />

MMU, <strong>the</strong> virtual memory subsystem implementation is different from <strong>the</strong> regular<br />

NetBSD VM. As already explained in Section 2.4, <strong>the</strong> most fundamental difference<br />

is that <strong>the</strong>re is no concept <strong>of</strong> page protection or a page fault inside <strong>the</strong> rump kernel.<br />

<strong>The</strong> details <strong>of</strong> <strong>the</strong> rump kernel VM implementation along with <strong>the</strong>ir implications<br />

are described in <strong>the</strong> following subsections. <strong>The</strong> VM is implemented in <strong>the</strong> source<br />

module sys/rump/librump/rumpkern/vm.c. Additionally, routines used purely by<br />

<strong>the</strong> file system faction are in sys/rump/librump/rumpvfs/vm_vfs.c.<br />

Pages<br />

When running on hardware, <strong>the</strong> pages described by <strong>the</strong> struct vmpage data structure<br />

correspond with hardware pages 7 . Since <strong>the</strong> rump kernel does not interface<br />

with memory management hardware, <strong>the</strong> size <strong>of</strong> <strong>the</strong> memory page is merely a programmatical<br />

construct: <strong>the</strong> kernel h<strong>and</strong>s out physical memory in multiples <strong>of</strong> <strong>the</strong><br />

page size. In a rump kernel this memory is allocated from <strong>the</strong> host <strong>and</strong> since <strong>the</strong>re<br />

is no memory protection or faults, <strong>the</strong> page size can in practice be any power <strong>of</strong><br />

two within a sensible size range. However, so far <strong>the</strong>re has been no reason to use<br />

anything different than <strong>the</strong> page size for <strong>the</strong> machine architecture <strong>the</strong> rump kernel<br />

is running on.<br />

<strong>The</strong>VMtracksstatus<strong>of</strong>whenapagewaslastused. Itdoesthistrackingei<strong>the</strong>r<br />

by asking <strong>the</strong> MMU on CPU architectures where that is supported, e.g. i386, or<br />

by using memory protection <strong>and</strong> updating <strong>the</strong> information during page faults on<br />

architectures where it is not, e.g. alpha.<br />

This information is used by <strong>the</strong> page<br />

daemon during memory shortages to decide which pages are best suited to be paged<br />

7 This correspondence is not a strict rule. For example <strong>the</strong> NetBSD VAX port uses clusters <strong>of</strong><br />

512 byte contiguous hardware pages to create logical 4kB pages to minimize management overhead.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!