Re: Page allocator: Single Zone optimizations

Mel Gorman
2006-11-02T20:58:20Z

On Thu, 2 Nov 2006, Christoph Lameter wrote:

> On Thu, 2 Nov 2006, Andy Whitcroft wrote:
>
>> with no reclaimable blocks regardless of algorithm. Unless we are going
>> to allow all pages to be reclaimed (which is a massive job of
>> unthinkable proportions IMO) then we need some kind of placement scheme
>> to aid reclaim.
>
> The pages clearly need to be separated according to movable and
> unmovable. However, I think reclaimable needs to be the default
> and some simple measures will make a significant portion of the pages that
> we cannot currently move movable.
>

Ok... list-based anti-frag identified three types of pages. From the
leading mail;

EasyReclaimable - These are userspace pages that are easily reclaimable. This
flag is set when it is known that the pages will be trivially reclaimed
by writing the page out to swap or syncing with backing storage

KernelReclaimable - These are allocations for some kernel caches that are
reclaimable or allocations that are known to be very short-lived.

KernelNonReclaimable - These are pages that are allocated by the kernel that
are not trivially reclaimed. For example, the memory allocated for a
loaded module would be in this category. By default, allocations are
considered to be of this type

The EasyReclaimable and KernelReclaimable allocations are marked with
__GFP flags.

Now, you want to separate pages according to movable and unmovable.
Broadly speaking, EasyReclaimable == Movable and
KernelReclaimable+KernelNonReclaimable == Non-Movable. However, while
KernelReclaimable are Non-Movable, they can be reclaimed by purging
caches. So, if we redefined the three terms to be Movable, Reclaimable and
Non-Movable, you get the separation you are looking for at least within a
MAX_ORDER_NR_PAGES.

> Unmovable pages need to be managed with some sort of special scheme and
> are need to be kept together in a separate pool or something, They do not
> need memory policy support f.e. Regular allocations should be left
> unchanged and continue to be handled as is. Unmovable pages may have a
> special flag or be handled in some special way.
>

"Special way" to me is just "place them somewhere smart". If their
location was really important for hot-unplug, a placement policy could
always use MAX_ORDER_NR_PAGES at the lower PFNs in a zone for them. This
should be easier than introducing additional memory pools, zones or other
mechanisms.

--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab