BSDCan2017 - 0413.2

BSDCan 2017
The Technical BSD Conference

Santhosh Raju
Day Talks #2 - 10 June - 2017-06-10
Room DMS 1120
Start time 10:00
Duration 00:45
ID 780
Event type Lecture
Track Invited Talks
Language used for presentation English

Portable Hotplugging

NetBSD's uvm_hotplug(9) API development.

NetBSD has quietly re-engineered its virtual memory subsystem over the years via uvm(9). uvm(9) is portable|to the point where usermode kernels, paravirtualised kernels and monolithic kernels all share the same MI VM code. (The notable exception being rumpkernel(7), which brews its own stubs).

One sticky point in all these configurations is the early boot time sys- tem memory segment management. On NetBSD, this was still "managed" via a static array.

We show how this static implementation was transformed into a dy- namically managed key/value pair system, almost entirely in userspace, and using Test Driven Development methodologies on NetBSD's testing framework.

We further show how this enabled us to measure the performance of our changes, within the limitations of NetBSD's testing framework by integrating load testing into our userspace development methodology.

The current implementation of uvm(9) uses a static array to "manage" memory segments. The uvm hotplug(9) API enables dynamically "managed" memory segments allowing for the possibility of hot plugging and unplugging of memory. During the process of implementing uvm hotplug(9) we used a Test Driven Development methodology and Pair Programming to achieve our goal.

This talk focuses on how to re-organize the code for testing, test design strategy for correctness and performance evaluation and the possibilities of testing kernel code in userspace, specifically code pertaining to uvm(9). The talk will also cover the methodology we used to achieve TDD on an existing code base which lacked any prior formal written tests. In addition to the above there will also be a small section on how tests(7) was used as a tool to measure performance by load testing.