Re: huge zero page vs FOLL_DUMP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 11, 2013 at 08:27:31PM -0800, Michel Lespinasse wrote:
> On Fri, Jan 11, 2013 at 7:36 PM, Kirill A. Shutemov
> > Could you tese the patch?
> >
> > From 062a9b670ede9fe5fca1d1947b42990b6b0642a4 Mon Sep 17 00:00:00 2001
> > From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
> > Date: Sat, 12 Jan 2013 05:18:58 +0200
> > Subject: [PATCH] thp: Avoid dumping huge zero page
> >
> > No reason to preserve huge zero page in core dump.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> > Reported-by: Michel Lespinasse <walken@xxxxxxxxxx>
> > ---
> >  mm/huge_memory.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > index 6001ee6..b5783d8 100644
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -1257,6 +1257,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
> >         if (flags & FOLL_WRITE && !pmd_write(*pmd))
> >                 goto out;
> >
> > +       /* Avoid dumping huge zero page */
> > +       if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd))
> > +               return ERR_PTR(-EFAULT);
> > +
> >         page = pmd_page(*pmd);
> >         VM_BUG_ON(!PageHead(page));
> >         if (flags & FOLL_TOUCH) {
> 
> Looks sane to me, and it also helps my munlock test (we were getting
> and dropping references on the zero page which made it noticeably
> slower). Thanks!
> 
> Reviewed-by: Michel Lespinasse <walken@xxxxxxxxxx>

Andrew, please take the patch.

-- 
 Kirill A. Shutemov

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]