Re: [PATCH 0/5] make slab gfp fair

Christoph Lameter
2007-05-17T22:27:57Z

On Thu, 17 May 2007, Peter Zijlstra wrote:

> The way I read the cpuset page allocator, it will only respect the
> cpuset if there is memory aplenty. Otherwise it will grab whatever. So
> still, it will only ever use ALLOC_NO_WATERMARKS if the whole system is
> in distress.

Sorry no. The purpose of the cpuset is to limit memory for an application.
If the boundaries would be fluid then we would not need cpusets.

But the same principles also apply for allocations to different zones in a
SMP system. There are 4 zones DMA DMA32 NORMAL and HIGHMEM and we have
general slabs for DMA and NORMAL. A slab that uses zone NORMAL falls back
to DMA32 and DMA depending on the watermarks of the 3 zones. So a
ZONE_NORMAL slab can exhaust memory available for ZONE_DMA.

Again the question is the watermarks of which zone? In case of the
ZONE_NORMAL allocation you have 3 to pick from. Its the last one? Then its
the same as ZONE_DMA, and you got a collision with the corresponding
DMA slab. Depending the system deciding on a zone where we allocate the
page from you may get a different watermark situation.

On x86_64 systems you have the additional complication that there are
even multiple DMA32 or NORMAL zones per node. Some will have DMA32 and
NORMAL, others DMA32 alone or NORMAL alone. Which watermarks are we
talking about?

The use of ALLOC_NO_WATERMARKS depends on the contraints of the allocation
in all cases. You can only compare the stresslevel (rank?) of allocations
that have the same allocation constraints. The allocation constraints are
a result of gfp flags, cpuset configuration and memory policies in effect.