Skip to content

Commit a501a07

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: report success more often from filemap_map_folio_range()
Even though we had successfully mapped the relevant page, we would rarely return success from filemap_map_folio_range(). That leads to falling back from the VMA lock path to the mmap_lock path, which is a speed & scalability issue. Found by inspection. Link: https://lkml.kernel.org/r/[email protected] Fixes: 617c28e ("filemap: batch PTE mappings") Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Yin Fengwei <[email protected]> Cc: Dave Hansen <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7c31515 commit a501a07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/filemap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3503,7 +3503,7 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
35033503
if (count) {
35043504
set_pte_range(vmf, folio, page, count, addr);
35053505
folio_ref_add(folio, count);
3506-
if (in_range(vmf->address, addr, count))
3506+
if (in_range(vmf->address, addr, count * PAGE_SIZE))
35073507
ret = VM_FAULT_NOPAGE;
35083508
}
35093509

@@ -3517,7 +3517,7 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
35173517
if (count) {
35183518
set_pte_range(vmf, folio, page, count, addr);
35193519
folio_ref_add(folio, count);
3520-
if (in_range(vmf->address, addr, count))
3520+
if (in_range(vmf->address, addr, count * PAGE_SIZE))
35213521
ret = VM_FAULT_NOPAGE;
35223522
}
35233523

0 commit comments

Comments
 (0)