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-next>] [day] [month] [year] [list]
Message-ID: <CAAmzW4MV4rqZsSkbUO385jiijMnLzW1i7U9DaikL-T4H8Pje=A@mail.gmail.com>
Date:   Fri, 12 Aug 2022 11:20:49 +0900
From:   Joonsoo Kim <js1304@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     mm-commits@...r.kernel.org, Matthew Wilcox <willy@...radead.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        David Hildenbrand <david@...hat.com>, corbet@....net,
        cgel.zte@...il.com, bsingharora@...il.com, yang.yang29@....com.cn,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: + filemap-make-the-accounting-of-thrashing-more-consistent.patch
 added to mm-unstable branch

Hello, Yang.

2022년 8월 12일 (금) 오전 7:10, Andrew Morton <akpm@...ux-foundation.org>님이 작성:
>
>
> The patch titled
>      Subject: filemap: make the accounting of thrashing more consistent
> has been added to the -mm mm-unstable branch.  Its filename is
>      filemap-make-the-accounting-of-thrashing-more-consistent.patch
>
> This patch will shortly appear at
>      https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/filemap-make-the-accounting-of-thrashing-more-consistent.patch
>
> This patch will later appear in the mm-unstable branch at
>     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
>
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
>
> The -mm tree is included into linux-next via the mm-everything
> branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> and is updated there every 2-3 working days
>
> ------------------------------------------------------
> From: Yang Yang <yang.yang29@....com.cn>
> Subject: filemap: make the accounting of thrashing more consistent
> Date: Fri, 5 Aug 2022 03:38:39 +0000
>
> Once upon a time, we only support accounting thrashing of page cache.
> Then Joonsoo introduced workingset detection for anonymous pages and we
> gained the ability to account thrashing of them[1].
>
> So let delayacct account both the thrashing of page cache and anonymous
> pages, this could make the codes more consistent and simpler.
>
> [1] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU")
>
> Link: https://lkml.kernel.org/r/20220805033838.1714674-1-yang.yang29@zte.com.cn
> Signed-off-by: Yang Yang <yang.yang29@....com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@...il.com>
> Cc: Balbir Singh <bsingharora@...il.com>
> Cc: Jonathan Corbet <corbet@....net>
> Cc: Matthew Wilcox (Oracle) <willy@...radead.org>
> Cc: Yang Yang <yang.yang29@....com.cn>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
>
>  Documentation/accounting/delay-accounting.rst |    2 -
>  mm/filemap.c                                  |   18 +++-------------
>  2 files changed, 5 insertions(+), 15 deletions(-)
>
> --- a/Documentation/accounting/delay-accounting.rst~filemap-make-the-accounting-of-thrashing-more-consistent
> +++ a/Documentation/accounting/delay-accounting.rst
> @@ -13,7 +13,7 @@ a) waiting for a CPU (while being runnab
>  b) completion of synchronous block I/O initiated by the task
>  c) swapping in pages
>  d) memory reclaim
> -e) thrashing page cache
> +e) thrashing
>  f) direct compact
>  g) write-protect copy
>
> --- a/mm/filemap.c~filemap-make-the-accounting-of-thrashing-more-consistent
> +++ a/mm/filemap.c
> @@ -1221,15 +1221,11 @@ static inline int folio_wait_bit_common(
>         struct wait_page_queue wait_page;
>         wait_queue_entry_t *wait = &wait_page.wait;
>         bool thrashing = false;
> -       bool delayacct = false;
>         unsigned long pflags;
>
>         if (bit_nr == PG_locked &&
>             !folio_test_uptodate(folio) && folio_test_workingset(folio)) {
> -               if (!folio_test_swapbacked(folio)) {
> -                       delayacct_thrashing_start();
> -                       delayacct = true;
> -               }
> +               delayacct_thrashing_start();
>                 psi_memstall_enter(&pflags);
>                 thrashing = true;
>         }

I think that a better place to measure swap thrashing is swap_readpage().
For some cases, like a zram, swap_readpage() is called directly rather than
loading the page onto the swap cache. Your code would miss that case.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ