percpu: relegate chunks unusable when failing small allocations
authorDennis Zhou <dennis@kernel.org>
Mon, 25 Feb 2019 17:03:50 +0000 (09:03 -0800)
committerDennis Zhou <dennis@kernel.org>
Wed, 13 Mar 2019 19:25:31 +0000 (12:25 -0700)
commit8744d859427c6198dce490619809754336954297
tree4d0a28eaac997430e93821ed4c6b82bb66b9a4f4
parent3e54097beb228ddcd73bb2fd18bafaa1062e9fe4
percpu: relegate chunks unusable when failing small allocations

In certain cases, requestors of percpu memory may want specific
alignments. However, it is possible to end up in situations where the
contig_hint matches, but the alignment does not. This causes excess
scanning of chunks that will fail. To prevent this, if a small
allocation fails (< 32B), the chunk is moved to the empty list. Once an
allocation is freed from that chunk, it is placed back into rotation.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
mm/percpu.c