]> git.baikalelectronics.ru Git - kernel.git/commit
lib/find: optimize for_each() macros
authorYury Norov <yury.norov@gmail.com>
Mon, 19 Sep 2022 21:05:58 +0000 (14:05 -0700)
committerYury Norov <yury.norov@gmail.com>
Sat, 1 Oct 2022 17:22:58 +0000 (10:22 -0700)
commit0310fb41b8ec6657b637d890da4a0a28677e875a
tree98dc830d9a0fde79da8df36e5e141d661e431a6b
parent3bd95061898de3e8700382cb18cfa9248a38ffa4
lib/find: optimize for_each() macros

Moving an iterator of the macros inside conditional part of for-loop
helps to generate a better code. It had been first implemented in commit
fe7436bba47f22a7 ("cpumask: make for_each_cpu_mask a bit smaller").

Now that cpumask for-loops are the aliases to bitmap loops, it's worth
to optimize them the same way.

Bloat-o-meter says:
add/remove: 8/12 grow/shrink: 147/592 up/down: 4876/-24416 (-19540)

Signed-off-by: Yury Norov <yury.norov@gmail.com>
include/linux/find.h