aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Kucharski <william.kucharski@oracle.com>2018-01-31 19:21:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-31 20:18:40 -0500
commitda391d640c528bc5bb227ea5b39c882b75ac3167 (patch)
tree284ee9659d8c530f61fdb6823f4fb53f0259597b
parent859d4adc3415a64ccb8b0c50dc4e3a888dcb5805 (diff)
mm: correct comments regarding do_fault_around()
There are multiple comments surrounding do_fault_around that memtion fault_around_pages() and fault_around_mask(), two routines that do not exist. These comments should be reworded to reference fault_around_bytes, the value which is used to determine how much do_fault_around() will attempt to read when processing a fault. These comments should have been updated when fault_around_pages() and fault_around_mask() were removed in commit aecd6f44266c ("mm: close race between do_fault_around() and fault_around_bytes_set()"). Fixes: aecd6f44266c1 ("mm: close race between do_fault_around() and fault_around_bytes_set()") Link: http://lkml.kernel.org/r/302D0B14-C7E9-44C6-8BED-033F9ACBD030@oracle.com Signed-off-by: William Kucharski <william.kucharski@oracle.com> Reviewed-by: Larry Bassel <larry.bassel@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/memory.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/mm/memory.c b/mm/memory.c
index a6e5d6ac5d24..53373b7a1512 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3511,9 +3511,8 @@ static int fault_around_bytes_get(void *data, u64 *val)
3511} 3511}
3512 3512
3513/* 3513/*
3514 * fault_around_pages() and fault_around_mask() expects fault_around_bytes 3514 * fault_around_bytes must be rounded down to the nearest page order as it's
3515 * rounded down to nearest page order. It's what do_fault_around() expects to 3515 * what do_fault_around() expects to see.
3516 * see.
3517 */ 3516 */
3518static int fault_around_bytes_set(void *data, u64 val) 3517static int fault_around_bytes_set(void *data, u64 val)
3519{ 3518{
@@ -3556,13 +3555,14 @@ late_initcall(fault_around_debugfs);
3556 * This function doesn't cross the VMA boundaries, in order to call map_pages() 3555 * This function doesn't cross the VMA boundaries, in order to call map_pages()
3557 * only once. 3556 * only once.
3558 * 3557 *
3559 * fault_around_pages() defines how many pages we'll try to map. 3558 * fault_around_bytes defines how many bytes we'll try to map.
3560 * do_fault_around() expects it to return a power of two less than or equal to 3559 * do_fault_around() expects it to be set to a power of two less than or equal
3561 * PTRS_PER_PTE. 3560 * to PTRS_PER_PTE.
3562 * 3561 *
3563 * The virtual address of the area that we map is naturally aligned to the 3562 * The virtual address of the area that we map is naturally aligned to
3564 * fault_around_pages() value (and therefore to page order). This way it's 3563 * fault_around_bytes rounded down to the machine page size
3565 * easier to guarantee that we don't cross page table boundaries. 3564 * (and therefore to page order). This way it's easier to guarantee
3565 * that we don't cross page table boundaries.
3566 */ 3566 */
3567static int do_fault_around(struct vm_fault *vmf) 3567static int do_fault_around(struct vm_fault *vmf)
3568{ 3568{
@@ -3579,8 +3579,8 @@ static int do_fault_around(struct vm_fault *vmf)
3579 start_pgoff -= off; 3579 start_pgoff -= off;
3580 3580
3581 /* 3581 /*
3582 * end_pgoff is either end of page table or end of vma 3582 * end_pgoff is either the end of the page table, the end of
3583 * or fault_around_pages() from start_pgoff, depending what is nearest. 3583 * the vma or nr_pages from start_pgoff, depending what is nearest.
3584 */ 3584 */
3585 end_pgoff = start_pgoff - 3585 end_pgoff = start_pgoff -
3586 ((vmf->address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) + 3586 ((vmf->address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) +