LWN.net Logo  Contiguous memory allocation for drivers  By
Jonathan Corbet July 21, 2010 Allocation of physically-
contiguous memory buffers is required by many device drivers,
but it cannot always be reliably done on long-running Linux
systems. That leads to all kinds of unsatisfying workarounds in
driver code. The contiguous memory allocator patches recently
posted by Michal Nazarewicz are an attempt to solve this problem
in a consistent way for all drivers.  A few years ago, when your
editor was writing the camera driver for the original OLPC XO
system, a problem turned up. The video acquisition hardware on
the system was capable of copying video frames into memory via
DMA operations, but only to physically contiguous buffers. There
was, in other words, no scatter/gather DMA capability built into
this (cheap) DMA engine. A choice was thus forced: either
allocate memory for video acquisition at boot time, or attempt
to allocate it on the fly when the camera is actually used. The
former choice is reliable, bu