lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHbLzkr967JVjnv=kyuUdYJvdAKKbQy67-MvUrb7VeQUZAuHXQ@mail.gmail.com>
Date:   Fri, 18 Oct 2019 14:54:09 -0700
From:   Yang Shi <shy828301@...il.com>
To:     "Kirill A. Shutemov" <kirill@...temov.name>
Cc:     Song Liu <songliubraving@...com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        matthew.wilcox@...cle.com, kernel-team@...com,
        william.kucharski@...cle.com,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH v2 4/5] mm/thp: allow drop THP from page cache

On Fri, Oct 18, 2019 at 6:32 AM Kirill A. Shutemov <kirill@...temov.name> wrote:
>
> On Thu, Oct 17, 2019 at 02:46:38PM -0700, Yang Shi wrote:
> > On Thu, Oct 17, 2019 at 9:42 AM Song Liu <songliubraving@...com> wrote:
> > >
> > > From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
> > >
> > > Once a THP is added to the page cache, it cannot be dropped via
> > > /proc/sys/vm/drop_caches. Fix this issue with proper handling in
> > > invalidate_mapping_pages().
> > >
> > > Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS")
> > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> > > Tested-by: Song Liu <songliubraving@...com>
> > > Signed-off-by: Song Liu <songliubraving@...com>
> > > ---
> > >  mm/truncate.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/mm/truncate.c b/mm/truncate.c
> > > index 8563339041f6..dd9ebc1da356 100644
> > > --- a/mm/truncate.c
> > > +++ b/mm/truncate.c
> > > @@ -592,6 +592,16 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
> > >                                         unlock_page(page);
> > >                                         continue;
> > >                                 }
> > > +
> > > +                               /* Take a pin outside pagevec */
> > > +                               get_page(page);
> > > +
> > > +                               /*
> > > +                                * Drop extra pins before trying to invalidate
> > > +                                * the huge page.
> > > +                                */
> > > +                               pagevec_remove_exceptionals(&pvec);
> > > +                               pagevec_release(&pvec);
> >
> > Shall we skip the outer pagevec_remove_exceptions() if it has been done here?
>
> It will be NOP and skipping would complicate the code.

Yes, it would be. Anyway, it looks ok too. Acked-by: Yang Shi
<yang.shi@...ux.alibaba.com>

>
> --
>  Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ