[PATCH 1/2] mm: Allow architectures to request 'old' entries when prefaulting

Matthew Wilcox willy at infradead.org
Wed Dec 9 15:32:03 EST 2020

On Wed, Dec 09, 2020 at 11:04:13AM -0800, Linus Torvalds wrote:
> In particular, it made it a nightmare to read what do_fault_around()
> does: it does that odd
>         if (pmd_none(*vmf->pmd)) {
>                 vmf->prealloc_pte = pte_alloc_one(vmf->vma->vm_mm);
> and then it calls ->map_pages() (which is always filemap_map_pages(),
> except for xfs, where it is also always filemap_map_pages but it takes
> a lock first).

... which is wrong.  Dave's paranoia around other people
introducing bugs into XFS made him do this, but we should revert
cd647d5651c0b0deaa26c1acb9e1789437ba9bc7.  Those operations he's
worried about are protected by the page lock.

If a filesystem has put an Uptodate page into the page cache, the
rest of the kernel can read it without telling the filesystem.

More information about the linux-arm-kernel mailing list