]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: update pcpu_find_block_fit to use an iterator
authorDennis Zhou (Facebook) <dennisszhou@gmail.com>
Mon, 24 Jul 2017 23:02:19 +0000 (19:02 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 26 Jul 2017 21:41:06 +0000 (17:41 -0400)
commit9dcc6cebe2fe617aca0119a5453ee2d5ad4eb024
tree301f2c2ed922ec0acd862bf042c20a397213bf8e
parent89d7e1f1da645b539766e7c8d9660454b7b3da94
percpu: update pcpu_find_block_fit to use an iterator

The simple, and expensive, way to find a free area is to iterate over
the entire bitmap until an area is found that fits the allocation size
and alignment. This patch makes use of an iterate that find an area to
check by using the block level contig hints. It will only return an area
that can fit the size and alignment request. If the request can fit
inside a block, it returns the first_free bit to start checking from to
see if it can be fulfilled prior to the contig hint. The pcpu_alloc_area
check has a bound of a block size added in case it is wrong.

Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/percpu.c