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: <CAHbLzkq+Rs9662FA+vChBt5it2SRXS0QiwG0Rx8m+BZFad6uyA@mail.gmail.com>
Date:   Fri, 10 Jul 2020 10:32:24 -0700
From:   Yang Shi <shy828301@...il.com>
To:     "Kirill A. Shutemov" <kirill@...temov.name>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Linux MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] Kill THP deferred split queue?

On Fri, Jul 10, 2020 at 7:18 AM Kirill A. Shutemov <kirill@...temov.name> wrote:
>
> On Tue, Jul 07, 2020 at 11:00:16AM -0700, Yang Shi wrote:
> > Hi folks,
> >
> > The THP deferred split queue is used to store PTE mapped THP (i.e.
> > partial unmapped THP) then they will get split by deferred split
> > shrinker when memory pressure kicks in.
> >
> > Now the page reclaim could handle such cases nicely without calling
> > the shrinker. Since the THPs on deferred split queue is not PMD mapped
> > so they will be split unconditionally, then the unmapped sub pages
> > would get freed. Please see the below code snippet:
> >
> >                              if (PageTransHuge(page)) {
> >                                         /* cannot split THP, skip it */
> >                                         if (!can_split_huge_page(page, NULL))
> >                                                 goto activate_locked;
> >                                         /*
> >                                          * Split pages without a PMD map right
> >                                          * away. Chances are some or all of the
> >                                          * tail pages can be freed without IO.
> >                                          */
> >                                         if (!compound_mapcount(page) &&
> >                                             split_huge_page_to_list(page,
> >                                                                     page_list))
> >                                                 goto activate_locked;
> >                                 }
> >
> > Then the unmapped pages will be moved to free_list by
> > move_pages_to_lru() called by shrink_inactive_list(). The mapped sub
> > pages will be kept on LRU. So, it does exactly the same thing as
> > deferred split shrinker and at the exact same timing.
> >
> > The only benefit of shrinker is they can be split and freed via "echo
> > 2 > /proc/sys/vm/drop_caches”, but I'm not sure how many people rely
> > on this?
> >
> > The benefit of killing deferred split queue is code simplification.
> >
> > Any comment is welcome.
>
> The point of handing it in shrinker is that these pages have to be dropped
> before anything potentially useful get reclaimed. If the compound page has
> any active PTEs you are unlikely to reach it during normal reclaim.

Thanks. Yes, it looks so. We can't tell if the THP has inactive PTEs
or not easily via page_referenced(). It looks the whole THP would be
treated as active as long as one subpage is active.

>
> --
>  Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ