Skip to content

teach kswapd about higher order allocations

Nick Piggin linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3keep count of free areasinclude/linux/mmzone.h mm/page_alloc.c+10 -140 replies
2/3higher order watermarksinclude/linux/mmzone.h mm/page_alloc.c+41 -1912 replies
3/3teach kswapd about higher order areasinclude/linux/mmzone.h mm/page_alloc.c mm/vmscan.c+34 -221 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] teach kswapd about higher order allocations

Hi Andrew,

Can this get into mm please?

I haven't been able to do a huge amount of testing, because there aren't many higher order allocations these days.

However:
I have got into situations where memory becomes completely fragmented and the Gbe network card starts spewing a lot of allocations failures. In some cases (eg. ifup) it will just sit there indefinitely cranking out order:2 allocation failures. These patches definitely fix those situations by having kswapd free some higher order areas.

Higher order area watermarks are enforced lazily - that is, if nobody is doing order 1 allocations, no attempt is ever made to free order 1 areas, even if none are available. Also, if kswapd can't free up the right amount of higher order areas, it eventually gives up on them until being kicked again.

In this way, I don't think this patch has any overscanning failure cases.

Note:
It generally doesn't take much work to free up memory to get networking going because the skb allocations are transient, so you only need some set number of higher order areas free, and the network buffers just keep reusing them. Other allocations don't tend to touch them much because the buddy allocator takes low order pages first.

Linus was the only one with any real objections, but once I explained myself better he thought this was fairly reasonable (I think).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>