percpu: remember largest area skipped during allocation
authorDennis Zhou <dennis@kernel.org>
Fri, 22 Feb 2019 17:03:16 +0000 (09:03 -0800)
committerDennis Zhou <dennis@kernel.org>
Wed, 13 Mar 2019 19:25:31 +0000 (12:25 -0700)
commitb89462a9c5f4a3ac5160e7b3599bb09c94b94880
treed35565be3b9b664080870d8f034ed8fe24f9859e
parent382b88e961c7a4196e01cef3249297583d02d608
percpu: remember largest area skipped during allocation

Percpu allocations attempt to do first fit by scanning forward from the
first_free of a block. However, fragmentation from allocation requests
can cause holes not seen by block hint update functions. To address
this, create a local version of bitmap_find_next_zero_area_off() that
remembers the largest area skipped over. The caveat is that it only sees
regions skipped over due to not fitting, not regions skipped due to
alignment.

Prior to updating the scan_hint, a scan backwards is done to try and
recover free bits skipped due to alignment. While this can cause
scanning to miss earlier possible free areas, smaller allocations will
eventually fill those holes due to first fit.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
mm/percpu.c