]> git.baikalelectronics.ru Git - kernel.git/commit
net: attempt a single high order allocation
authorEric Dumazet <edumazet@google.com>
Thu, 28 Aug 2014 03:49:34 +0000 (20:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Aug 2014 03:28:23 +0000 (20:28 -0700)
commit54f18f4437d9940dd97a19afe251f9af1ab23b95
tree6916bac985be5ffe9d282a94cd55bf2a754bdf53
parente26b8e7c8133fb21c205d64d0b6d0ae9ceb2ab7a
net: attempt a single high order allocation

In commit 930b08026215 ("net: use __GFP_NORETRY for high order
allocations") we tried to address one issue caused by order-3
allocations.

We still observe high latencies and system overhead in situations where
compaction is not successful.

Instead of trying order-3, order-2, and order-1, do a single order-3
best effort and immediately fallback to plain order-0.

This mimics slub strategy to fallback to slab min order if the high
order allocation used for performance failed.

Order-3 allocations give a performance boost only if they can be done
without recurring and expensive memory scan.

Quoting David :

The page allocator relies on synchronous (sync light) memory compaction
after direct reclaim for allocations that don't retry and deferred
compaction doesn't work with this strategy because the allocation order
is always decreasing from the previous failed attempt.

This means sync light compaction will always be encountered if memory
cannot be defragmented or reclaimed several times during the
skb_page_frag_refill() iteration.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c