[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBCP+YvA46j8K7pXDGBLdLgh2+Db9RDrHU4DP7JHsv_Qcw@mail.gmail.com>
Date: Thu, 23 May 2013 19:36:43 +0800
From: Hillf Danton <dhillf@...il.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Hugh Dickins <hughd@...gle.com>,
Wu Fengguang <fengguang.wu@...el.com>, Jan Kara <jack@...e.cz>,
Mel Gorman <mgorman@...e.de>, linux-mm@...ck.org,
Andi Kleen <ak@...ux.intel.com>,
Matthew Wilcox <matthew.r.wilcox@...el.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Dave Hansen <dave@...1.net>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 39/39] thp: map file-backed huge pages on fault
On Sun, May 12, 2013 at 9:23 AM, Kirill A. Shutemov
<kirill.shutemov@...ux.intel.com> wrote:
> From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
>
> Look like all pieces are in place, we can map file-backed huge-pages
> now.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> ---
> include/linux/huge_mm.h | 4 +++-
> mm/memory.c | 5 ++++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
> index f4d6626..903f097 100644
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -78,7 +78,9 @@ extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
> (1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG) && \
> ((__vma)->vm_flags & VM_HUGEPAGE))) && \
> !((__vma)->vm_flags & VM_NOHUGEPAGE) && \
> - !is_vma_temporary_stack(__vma))
> + !is_vma_temporary_stack(__vma) && \
> + (!(__vma)->vm_ops || \
> + mapping_can_have_hugepages((__vma)->vm_file->f_mapping)))
Redefine, why?
> #define transparent_hugepage_defrag(__vma) \
> ((transparent_hugepage_flags & \
> (1<<TRANSPARENT_HUGEPAGE_DEFRAG_FLAG)) || \
> diff --git a/mm/memory.c b/mm/memory.c
> index ebff552..7fe9752 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3939,10 +3939,13 @@ retry:
> if (!pmd)
> return VM_FAULT_OOM;
> if (pmd_none(*pmd) && transparent_hugepage_enabled(vma)) {
> - int ret = 0;
> + int ret;
> if (!vma->vm_ops)
> ret = do_huge_pmd_anonymous_page(mm, vma, address,
> pmd, flags);
Ah vma->vm_ops is checked here, so
else if (mapping_can_have_hugepages())
> + else
> + ret = do_huge_linear_fault(mm, vma, address,
> + pmd, flags);
> if ((ret & VM_FAULT_FALLBACK) == 0)
> return ret;
> } else {
> --
> 1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists