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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbLzkqE+i8Y+YQE-6DJgED6Hwpa4BftNdVHgpB1YT7sEcPVcw@mail.gmail.com>
Date:   Wed, 12 Aug 2020 22:19:24 -0700
From:   Yang Shi <shy828301@...il.com>
To:     Yu Zhao <yuzhao@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
        Huang Ying <ying.huang@...el.com>,
        David Hildenbrand <david@...hat.com>,
        Michal Hocko <mhocko@...e.com>,
        Yang Shi <yang.shi@...ux.alibaba.com>, Qian Cai <cai@....pw>,
        Mel Gorman <mgorman@...e.de>,
        Nicholas Piggin <npiggin@...il.com>,
        Jérôme Glisse <jglisse@...hat.com>,
        Hugh Dickins <hughd@...gle.com>, Linux MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Joonsoo Kim <js1304@...il.com>
Subject: Re: [PATCH 1/3] mm: don't call activate_page() on new ksm pages

On Tue, Aug 11, 2020 at 9:04 PM Yu Zhao <yuzhao@...gle.com> wrote:
>
> lru_cache_add_active_or_unevictable() already adds new ksm pages to
> active lru. Calling activate_page() isn't really necessary in this
> case.
>
> Signed-off-by: Yu Zhao <yuzhao@...gle.com>
> ---
>  mm/swapfile.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 6c26916e95fd..cf115ea26a20 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -1913,16 +1913,16 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
>                    pte_mkold(mk_pte(page, vma->vm_page_prot)));
>         if (page == swapcache) {
>                 page_add_anon_rmap(page, vma, addr, false);
> +               /*
> +                * Move the page to the active list so it is not
> +                * immediately swapped out again after swapon.
> +                */
> +               activate_page(page);

Actually I think we could just remove this activate_page() call with
Joonsoo's anonymous page workingset series merged. The active bit will
be taken care by workingset_refault().

>         } else { /* ksm created a completely new copy */
>                 page_add_new_anon_rmap(page, vma, addr, false);
>                 lru_cache_add_active_or_unevictable(page, vma);

And it looks the latest linus's tree already changed this to
lru_cache_add_inactive_or_unevictable() by commit b518154e59
("mm/vmscan: protect the workingset on anonymous LRU")

Added Joonsoo in this loop.

>         }
>         swap_free(entry);
> -       /*
> -        * Move the page to the active list so it is not
> -        * immediately swapped out again after swapon.
> -        */
> -       activate_page(page);
>  out:
>         pte_unmap_unlock(pte, ptl);
>         if (page != swapcache) {
> --
> 2.28.0.236.gb10cc79966-goog
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ