Message ID | 20240327055406.1339636-1-zhaoyang.huang@unisoc.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: fix unproperly folio_put by changing API in read_pages | expand |
On Wed, Mar 27, 2024 at 01:54:06PM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang <zhaoyang.huang@unisoc.com> > > According to the comments of readahead_page[3], the refcnt which > represents page cache dropped in [1] makes sense for two reasons, '1. > The folio is going to do IO and is locked until IO done;2. The refcnt > will be added back when found again from the page cache and then serve > for PTE or vfs' while it doesn't make sense in [2] as the refcnt of > page cache will be dropped in filemap_remove_folio. NAK, per previous email.
diff --git a/mm/readahead.c b/mm/readahead.c index 130c0e7df99f..657736200a92 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -163,7 +163,7 @@ static void read_pages(struct readahead_control *rac) * may be used to size the next readahead, so make sure * they accurately reflect what happened. */ - while ((folio = readahead_folio(rac)) != NULL) { + while ((folio = __readahead_folio(rac)) != NULL) { unsigned long nr = folio_nr_pages(folio); folio_get(folio);