lkml.org 
[lkml]   [2013]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] hugetlbfs: add swap entry check in follow_hugetlb_page()
On Fri 29-03-13 13:23:38, Naoya Horiguchi wrote:
> Hi,
>
> On Fri, Mar 29, 2013 at 02:57:30PM +0100, Michal Hocko wrote:
> > On Thu 28-03-13 11:42:38, Naoya Horiguchi wrote:
> > [...]
> > > @@ -2968,7 +2968,8 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
> > > * first, for the page indexing below to work.
> > > */
> > > pte = huge_pte_offset(mm, vaddr & huge_page_mask(h));
> > > - absent = !pte || huge_pte_none(huge_ptep_get(pte));
> > > + absent = !pte || huge_pte_none(huge_ptep_get(pte)) ||
> > > + is_swap_pte(huge_ptep_get(pte));
> >
> > is_swap_pte doesn't seem right. Shouldn't you use is_hugetlb_entry_hwpoisoned
> > instead?
>
> I tested only hwpoisoned hugepage, but the same can happen for hugepages
> under migration. So I intended to filter out all types of swap entries.
> The local variable 'absent' seems to mean whether data on the address
> is immediately available, so swap type entry isn't included in it.

OK, I didn't consider huge pages under migration and I was merely worried
that is_hugetlb_entry_hwpoisoned sounds more appropriate than
is_swap_pte.

Could you add a comment which would clarify that is_swap_pte covers both
migration and hwpoison pages, please? Something like:

/*
* is_swap_pte test covers both is_hugetlb_entry_hwpoisoned
* and hugepages under migration in which case
* hugetlb_fault waits for the migration and bails out
* properly for HWPosined pages.
*/
absent = !pte || huge_pte_none(huge_ptep_get(pte)) ||
is_swap_pte(huge_ptep_get(pte));

Other than that feel free to add
Reviewed-by: Michal Hocko <mhocko@suse.cz>

Thanks.
--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2013-04-02 12:01    [W:0.055 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site