Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1567135
| From | "Hillf Danton" <hillf.zj@alibaba-inc.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv2 05/12] mm, rmap: check all VMAs that PTE-mapped THP can be part of |
| Date | 2017-01-26 08:00 +0100 |
| Message-ID | <t3Mch-44l-3@gated-at.bofh.it> (permalink) |
| References | <t3Auu-5et-11@gated-at.bofh.it> <t3Auu-5et-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On January 26, 2017 2:26 AM Kirill A. Shutemov wrote:
> @@ -333,12 +333,15 @@ __vma_address(struct page *page, struct vm_area_struct *vma)
> static inline unsigned long
> vma_address(struct page *page, struct vm_area_struct *vma)
> {
> - unsigned long address = __vma_address(page, vma);
> + unsigned long start, end;
> +
> + start = __vma_address(page, vma);
> + end = start + PAGE_SIZE * (hpage_nr_pages(page) - 1);
>
> /* page should be within @vma mapping range */
> - VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma);
> + VM_BUG_ON_VMA(end < vma->vm_start || start >= vma->vm_end, vma);
>
> - return address;
> + return max(start, vma->vm_start);
> }
Nit: currently it's buggy if page is not within the mapping range.
In this work fix is added for start if unlikely it goes outside range, and
its currently relevant debugging is cut off.
Other than that,
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCHv2 05/12] mm, rmap: check all VMAs that PTE-mapped THP can be part of "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-25 19:30 +0100 Re: [PATCHv2 05/12] mm, rmap: check all VMAs that PTE-mapped THP can be part of "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-26 08:00 +0100
csiph-web