Skip to contentSkip to conversation

mm-readahead-simplify-page_cache_ra_unbounded-loop-counter-reset.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 2

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/readahead: simplify page_cache_ra_unbounded loop counter reset
has been removed from the -mm tree. Its filename was
mm-readahead-simplify-page_cache_ra_unbounded-loop-counter-reset.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Frederick Mayle <[email protected]>
Subject: mm/readahead: simplify page_cache_ra_unbounded loop counter reset
Date: Tue, 12 May 2026 13:31:36 -0700

Minor cleanup, no behavior change intended.

read_pages ensures that ractl->_nr_pages is zero before it returns, so the ractl->_nr_pages term in these expressions contributes nothing. This seems to have been true since the statements were introduced in commit f615bd5c4725f ("mm/readahead: Handle ractl nr_pages being modified").

The new expression has an intuitive explanation. When filesystems perform readahead, they increment ractl->_index by the number of pages processed, so, after read_pages returns, ractl->_index points to the first page after those already processed. index points to the first page considered in the loop. So, ractl->_index - index is the number of pages processed by the loop so far.

---

 mm/readahead.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/readahead.c renamed from mm/readahead.c~mm-readahead-simplify-page_cache_ra_unbounded-loop-counter-reset +2 -2
@@ -281,7 +281,7 @@ void page_cache_ra_unbounded(struct read
 			 */
 			read_pages(ractl);
 			ractl->_index += min_nrpages;
-			i = ractl->_index + ractl->_nr_pages - index;
+			i = ractl->_index - index;
 			continue;
 		}
 
@@ -297,7 +297,7 @@ void page_cache_ra_unbounded(struct read
 				break;
 			read_pages(ractl);
 			ractl->_index += min_nrpages;
-			i = ractl->_index + ractl->_nr_pages - index;
+			i = ractl->_index - index;
 			continue;
 		}
 		if (i == mark)

_

Patches currently in -mm which might be from [email protected] are