On Thu, Nov 09, 2023 at 09:06:08PM +0000, Matthew Wilcox (Oracle) wrote: > Replace the shift with a divide, which is probably cheaper than first > calculating the shift. No. The divs are almost certainly more expensive on most CPUs, especially when doing two of them. On x86_64 for example, it will be two div instructions instead of one bsr and two shr instructions. The two divs are much more costly. The block size is always a power of 2; we should take advantage of that. - Eric