Re: [PATCH v1] mm/readahead: Optimize nr_to_read boundary check

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

 



On Fri, Jul 25, 2025 at 11:28:34PM +0800, Xiaole He wrote:
> If nr_to_read is, for instance, 3, and end_index - index + 1 is also 3
> (meaning 3 pages remain), the condition 3 > 2 evaluates to true, leading
>  to nr_to_read being assigned 3 again. While compilers might optimize
> this trivial self-assignment, it introduces unnecessary logical overhead
>  and reduces code clarity.

But it makes the initial comparison more complex (by one operation) and
I bet you can't measure the difference anyway.  I'm not inclined to
tweak this.





[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