Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1322617 > unrolled thread
| Started by | Matthew Wilcox <matthew.r.wilcox@intel.com> |
|---|---|
| First post | 2016-01-31 13:20 +0100 |
| Last post | 2016-02-01 21:50 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] mm: Use linear_page_index() in do_fault() Matthew Wilcox <matthew.r.wilcox@intel.com> - 2016-01-31 13:20 +0100
Re: [PATCH] mm: Use linear_page_index() in do_fault() "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-02-01 14:10 +0100
Re: [PATCH] mm: Use linear_page_index() in do_fault() Matthew Wilcox <willy@linux.intel.com> - 2016-02-01 21:50 +0100
| From | Matthew Wilcox <matthew.r.wilcox@intel.com> |
|---|---|
| Date | 2016-01-31 13:20 +0100 |
| Subject | [PATCH] mm: Use linear_page_index() in do_fault() |
| Message-ID | <qWZ90-38Q-1@gated-at.bofh.it> |
do_fault assumes that PAGE_SIZE is the same as PAGE_CACHE_SIZE.
Use linear_page_index() to calculate pgoff in the correct units.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
---
mm/memory.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 554816b..5224c06 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3161,8 +3161,7 @@ static int do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned long address, pte_t *page_table, pmd_t *pmd,
unsigned int flags, pte_t orig_pte)
{
- pgoff_t pgoff = (((address & PAGE_MASK)
- - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
+ pgoff_t pgoff = linear_page_index(vma, address);
pte_unmap(page_table);
/* The VMA was not fully populated on mmap() or missing VM_DONTEXPAND */
--
2.7.0.rc3
[toc] | [next] | [standalone]
| From | "Kirill A. Shutemov" <kirill@shutemov.name> |
|---|---|
| Date | 2016-02-01 14:10 +0100 |
| Message-ID | <qXmoW-3eN-27@gated-at.bofh.it> |
| In reply to | #1322617 |
On Sun, Jan 31, 2016 at 11:13:21PM +1100, Matthew Wilcox wrote:
> do_fault assumes that PAGE_SIZE is the same as PAGE_CACHE_SIZE.
> Use linear_page_index() to calculate pgoff in the correct units.
>
> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
'linear' part of helper name is not relevant any more since we've dropped
non-linear mappings. Probably, we should rename helpers.
> ---
> mm/memory.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 554816b..5224c06 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3161,8 +3161,7 @@ static int do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
> unsigned long address, pte_t *page_table, pmd_t *pmd,
> unsigned int flags, pte_t orig_pte)
> {
> - pgoff_t pgoff = (((address & PAGE_MASK)
> - - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
> + pgoff_t pgoff = linear_page_index(vma, address);
>
> pte_unmap(page_table);
> /* The VMA was not fully populated on mmap() or missing VM_DONTEXPAND */
> --
> 2.7.0.rc3
>
> --
> 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>
--
Kirill A. Shutemov
[toc] | [prev] | [next] | [standalone]
| From | Matthew Wilcox <willy@linux.intel.com> |
|---|---|
| Date | 2016-02-01 21:50 +0100 |
| Message-ID | <qXtA6-8mr-9@gated-at.bofh.it> |
| In reply to | #1323069 |
On Mon, Feb 01, 2016 at 03:06:38PM +0200, Kirill A. Shutemov wrote: > On Sun, Jan 31, 2016 at 11:13:21PM +1100, Matthew Wilcox wrote: > > do_fault assumes that PAGE_SIZE is the same as PAGE_CACHE_SIZE. > > Use linear_page_index() to calculate pgoff in the correct units. > > > > Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> > > Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> > > 'linear' part of helper name is not relevant any more since we've dropped > non-linear mappings. Probably, we should rename helpers. Ah, that's what it was named for. Yes, probably.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web