Thanks for your quick review and feedback. I understand your points regarding the minimal performance impact and the preference for keeping the current logic given its long-standing correctness. I agree that the change is indeed minor in scope. No worries at all, I appreciate you taking the time to consider the patch. Best regards, | | Xiaole He | | hexiaole1994@126.com | ---- Replied Message ---- | From | Matthew Wilcox | | Date | 7/25/2025 23:45 | | To | Xiaole He | | Cc | Andrew Morton, , , | | Subject | Re: [PATCH v1] mm/readahead: Optimize nr_to_read boundary check | 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.