Re: [PATCH v3 04/11] readahead: rework loop in page_cache_ra_unbounded()

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

 



On 3/25/24 19:41, Matthew Wilcox wrote:
On Wed, Mar 13, 2024 at 06:02:46PM +0100, Pankaj Raghav (Samsung) wrote:
@@ -239,8 +239,8 @@ void page_cache_ra_unbounded(struct readahead_control *ractl,
  			 * not worth getting one just for that.
  			 */
  			read_pages(ractl);
-			ractl->_index++;
-			i = ractl->_index + ractl->_nr_pages - index - 1;
+			ractl->_index += folio_nr_pages(folio);
+			i = ractl->_index + ractl->_nr_pages - index;
  			continue;
  		}
@@ -252,13 +252,14 @@ void page_cache_ra_unbounded(struct readahead_control *ractl,
  			folio_put(folio);
  			read_pages(ractl);
  			ractl->_index++;
-			i = ractl->_index + ractl->_nr_pages - index - 1;
+			i = ractl->_index + ractl->_nr_pages - index;
  			continue;
  		}

You changed index++ in the first hunk, but not the second hunk.  Is that
intentional?

Hmm. Looks you are right; it should be modified, too.
Will be fixing it up.

Cheers,

Hannes





[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