Re: [RFC][patch 0/2] mm: remove PageReserved

Roman Zippel
2005-08-09T19:49:04Z

Hi,

On Tue, 9 Aug 2005, Hugh Dickins wrote:

> PageReserved is about those pages which are managed by PageReserved.
> But quite what it means is unclear, one of the reasons to eliminate it.
> (Why is kernel text PageReserved?)

Short answer: /dev/mem
(Amazing that nobody mentioned it so far...)

To understand PageReserved it probably helps to know its history. One of
the first users of this was X so it can map the video memory. This flag
was the only way to distinguish which pages can be mapped this way, as
remap_page_range() has no idea who owns the page. The vm also used this
flag to skip these pages.

Later this was also used by drivers to map pages into user space using
remap_page_range() (as alternative to the nopage handler). Only later came
VM_RESERVED, IIRC it was first an optimization to avoid scanning these
mappings.

So the actual meaning of this flag is that if it's set the page structure
must not be changed and all fields must be treated as reserved. Only the
owner of the page who did set this flag can do whatever he wants with it.

bye, Roman