Re: [PATCH v2 7/7] buffer: Fix more functions for block size > PAGE_SIZE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux