Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'folio-5.19b' of git://git.infradead.org/users/willy/pagecache

Pull pagecache fixes from Matthew Wilcox:
"Four folio-related fixes for 5.19:

- Mark a folio accessed at the right time (Yu Kuai)

- Fix a race for folios being replaced in the middle of a read (Brian
Foster)

- Clear folio->private in more places (Xiubo Li)

- Take the invalidate_lock in page_cache_ra_order() (Alistair Popple)"

* tag 'folio-5.19b' of git://git.infradead.org/users/willy/pagecache:
filemap: Fix serialization adding transparent huge pages to page cache
mm: Clear page->private when splitting or migrating a page
filemap: Handle sibling entries in filemap_get_read_batch()
filemap: Correct the conditions for marking a folio as accessed

+16 -3
+12 -3
mm/filemap.c
··· 2385 2385 continue; 2386 2386 if (xas.xa_index > max || xa_is_value(folio)) 2387 2387 break; 2388 + if (xa_is_sibling(folio)) 2389 + break; 2388 2390 if (!folio_try_get_rcu(folio)) 2389 2391 goto retry; 2390 2392 ··· 2631 2629 return err; 2632 2630 } 2633 2631 2632 + static inline bool pos_same_folio(loff_t pos1, loff_t pos2, struct folio *folio) 2633 + { 2634 + unsigned int shift = folio_shift(folio); 2635 + 2636 + return (pos1 >> shift == pos2 >> shift); 2637 + } 2638 + 2634 2639 /** 2635 2640 * filemap_read - Read data from the page cache. 2636 2641 * @iocb: The iocb to read. ··· 2709 2700 writably_mapped = mapping_writably_mapped(mapping); 2710 2701 2711 2702 /* 2712 - * When a sequential read accesses a page several times, only 2703 + * When a read accesses the same folio several times, only 2713 2704 * mark it as accessed the first time. 2714 2705 */ 2715 - if (iocb->ki_pos >> PAGE_SHIFT != 2716 - ra->prev_pos >> PAGE_SHIFT) 2706 + if (!pos_same_folio(iocb->ki_pos, ra->prev_pos - 1, 2707 + fbatch.folios[0])) 2717 2708 folio_mark_accessed(fbatch.folios[0]); 2718 2709 2719 2710 for (i = 0; i < folio_batch_count(&fbatch); i++) {
+1
mm/huge_memory.c
··· 2377 2377 page_tail); 2378 2378 page_tail->mapping = head->mapping; 2379 2379 page_tail->index = head->index + tail; 2380 + page_tail->private = 0; 2380 2381 2381 2382 /* Page flags must be visible before we make the page non-compound. */ 2382 2383 smp_wmb();
+1
mm/migrate.c
··· 1106 1106 if (!newpage) 1107 1107 return -ENOMEM; 1108 1108 1109 + newpage->private = 0; 1109 1110 rc = __unmap_and_move(page, newpage, force, mode); 1110 1111 if (rc == MIGRATEPAGE_SUCCESS) 1111 1112 set_page_owner_migrate_reason(newpage, reason);
+2
mm/readahead.c
··· 510 510 new_order--; 511 511 } 512 512 513 + filemap_invalidate_lock_shared(mapping); 513 514 while (index <= limit) { 514 515 unsigned int order = new_order; 515 516 ··· 537 536 } 538 537 539 538 read_pages(ractl); 539 + filemap_invalidate_unlock_shared(mapping); 540 540 541 541 /* 542 542 * If there were already pages in the page cache, then we may have