* [PATCH v2] mm: Correct comments regarding do_fault_around()
@ 2018-01-27 3:25 ` William Kucharski
0 siblings, 0 replies; 4+ messages in thread
From: William Kucharski @ 2018-01-27 3:25 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: Andrew Morton, Michal Hocko, Kirill A. Shutemov
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
aecd6f44266c13b8709245b21ded2d19291ab070.
Signed-off-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: Larry Bassel <larry.bassel@oracle.com>
---
memory.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 793004608332..885dffe194f8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3485,9 +3485,8 @@ static int fault_around_bytes_get(void *data, u64 *val)
}
/*
- * fault_around_pages() and fault_around_mask() expects fault_around_bytes
- * rounded down to nearest page order. It's what do_fault_around() expects to
- * see.
+ * fault_around_bytes must be rounded down to the nearest page order as it's
+ * what do_fault_around() expects to see.
*/
static int fault_around_bytes_set(void *data, u64 val)
{
@@ -3530,13 +3529,14 @@ late_initcall(fault_around_debugfs);
* This function doesn't cross the VMA boundaries, in order to call map_pages()
* only once.
*
- * fault_around_pages() defines how many pages we'll try to map.
- * do_fault_around() expects it to return a power of two less than or equal to
- * PTRS_PER_PTE.
+ * fault_around_bytes defines how many bytes we'll try to map.
+ * do_fault_around() expects it to be set to a power of two less than or equal
+ * to PTRS_PER_PTE.
*
- * The virtual address of the area that we map is naturally aligned to the
- * fault_around_pages() value (and therefore to page order). This way it's
- * easier to guarantee that we don't cross page table boundaries.
+ * The virtual address of the area that we map is naturally aligned to
+ * fault_around_bytes rounded down to the machine page size
+ * (and therefore to page order). This way it's easier to guarantee
+ * that we don't cross page table boundaries.
*/
static int do_fault_around(struct vm_fault *vmf)
{
@@ -3553,8 +3553,8 @@ static int do_fault_around(struct vm_fault *vmf)
start_pgoff -= off;
/*
- * end_pgoff is either end of page table or end of vma
- * or fault_around_pages() from start_pgoff, depending what is nearest.
+ * end_pgoff is either the end of the page table, the end of
+ * the vma or nr_pages from start_pgoff, depending what is nearest.
*/
end_pgoff = start_pgoff -
((vmf->address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) +
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] mm: Correct comments regarding do_fault_around()
@ 2018-01-27 3:25 ` William Kucharski
0 siblings, 0 replies; 4+ messages in thread
From: William Kucharski @ 2018-01-27 3:25 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: Andrew Morton, Michal Hocko, Kirill A. Shutemov
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
aecd6f44266c13b8709245b21ded2d19291ab070.
Signed-off-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: Larry Bassel <larry.bassel@oracle.com>
---
memory.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 793004608332..885dffe194f8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3485,9 +3485,8 @@ static int fault_around_bytes_get(void *data, u64 *val)
}
/*
- * fault_around_pages() and fault_around_mask() expects fault_around_bytes
- * rounded down to nearest page order. It's what do_fault_around() expects to
- * see.
+ * fault_around_bytes must be rounded down to the nearest page order as it's
+ * what do_fault_around() expects to see.
*/
static int fault_around_bytes_set(void *data, u64 val)
{
@@ -3530,13 +3529,14 @@ late_initcall(fault_around_debugfs);
* This function doesn't cross the VMA boundaries, in order to call map_pages()
* only once.
*
- * fault_around_pages() defines how many pages we'll try to map.
- * do_fault_around() expects it to return a power of two less than or equal to
- * PTRS_PER_PTE.
+ * fault_around_bytes defines how many bytes we'll try to map.
+ * do_fault_around() expects it to be set to a power of two less than or equal
+ * to PTRS_PER_PTE.
*
- * The virtual address of the area that we map is naturally aligned to the
- * fault_around_pages() value (and therefore to page order). This way it's
- * easier to guarantee that we don't cross page table boundaries.
+ * The virtual address of the area that we map is naturally aligned to
+ * fault_around_bytes rounded down to the machine page size
+ * (and therefore to page order). This way it's easier to guarantee
+ * that we don't cross page table boundaries.
*/
static int do_fault_around(struct vm_fault *vmf)
{
@@ -3553,8 +3553,8 @@ static int do_fault_around(struct vm_fault *vmf)
start_pgoff -= off;
/*
- * end_pgoff is either end of page table or end of vma
- * or fault_around_pages() from start_pgoff, depending what is nearest.
+ * end_pgoff is either the end of the page table, the end of
+ * the vma or nr_pages from start_pgoff, depending what is nearest.
*/
end_pgoff = start_pgoff -
((vmf->address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) +
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] mm: Correct comments regarding do_fault_around()
@ 2018-01-27 3:23 ` William Kucharski
0 siblings, 0 replies; 4+ messages in thread
From: William Kucharski @ 2018-01-27 3:23 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: Andrew Morton, Michal Hocko, Kirill A. Shutemov
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] mm: Correct comments regarding do_fault_around()
@ 2018-01-27 3:23 ` William Kucharski
0 siblings, 0 replies; 4+ messages in thread
From: William Kucharski @ 2018-01-27 3:23 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: Andrew Morton, Michal Hocko, Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-27 3:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27 3:25 [PATCH v2] mm: Correct comments regarding do_fault_around() William Kucharski
2018-01-27 3:25 ` William Kucharski
-- strict thread matches above, loose matches on Subject: below --
2018-01-27 3:23 William Kucharski
2018-01-27 3:23 ` William Kucharski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.