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: <CAOUHufZNi1ZY-XEh_6EokrQgQzDPipe5_dURT5+ePEVUkoQ0pQ@mail.gmail.com>
Date: Mon, 23 Dec 2024 21:19:29 -0700
From: Yu Zhao <yuzhao@...gle.com>
To: Chen Ridong <chenridong@...weicloud.com>
Cc: akpm@...ux-foundation.org, mhocko@...e.com, hannes@...xchg.org, 
	yosryahmed@...gle.com, david@...hat.com, willy@...radead.org, 
	ryan.roberts@....com, baohua@...nel.org, 21cnbao@...il.com, 
	wangkefeng.wang@...wei.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	chenridong@...wei.com, wangweiyang2@...wei.com, xieym_ict@...mail.com
Subject: Re: [PATCH -next v6] mm: vmscan: retry folios written back while
 isolated for traditional LRU

On Mon, Dec 23, 2024 at 1:30 AM Chen Ridong <chenridong@...weicloud.com> wrote:
>
> From: Chen Ridong <chenridong@...wei.com>
>
> The page reclaim isolates a batch of folios from the tail of one of the
> LRU lists and works on those folios one by one.  For a suitable
> swap-backed folio, if the swap device is async, it queues that folio for
> writeback.  After the page reclaim finishes an entire batch, it puts back
> the folios it queued for writeback to the head of the original LRU list.
>
> In the meantime, the page writeback flushes the queued folios also by
> batches.  Its batching logic is independent from that of the page reclaim.
> For each of the folios it writes back, the page writeback calls
> folio_rotate_reclaimable() which tries to rotate a folio to the tail.
>
> folio_rotate_reclaimable() only works for a folio after the page reclaim
> has put it back.  If an async swap device is fast enough, the page
> writeback can finish with that folio while the page reclaim is still
> working on the rest of the batch containing it.  In this case, that folio
> will remain at the head and the page reclaim will not retry it before
> reaching there.

For starters, copying & pasting others' commit messages as your own is
plagiarism. You need to quote them.

> The commit 359a5e1416ca ("mm: multi-gen LRU: retry folios written back
> while isolated") only fixed the issue for mglru. However, this issue
> also exists in the traditional active/inactive LRU.

You need to prove it with some numbers.

> This issue will be
> worse if THP is split, which makes the list longer and needs longer time
> to finish a batch of folios reclaim.
>
> This issue should be fixed in the same way for the traditional LRU.
> Therefore, the common logic was extracted to the 'find_folios_written_back'
> function firstly, which is then reused in the 'shrink_inactive_list'
> function. Finally, retry reclaiming those folios that may have missed the
> rotation for traditional LRU.
>
> Link: https://lore.kernel.org/linux-kernel/20241010081802.290893-1-chenridong@huaweicloud.com/
> Link: https://lore.kernel.org/linux-kernel/CAGsJ_4zqL8ZHNRZ44o_CC69kE7DBVXvbZfvmQxMGiFqRxqHQdA@mail.gmail.com/
> Signed-off-by: Chen Ridong <chenridong@...wei.com>
> Reviewed-by: Barry Song <baohua@...nel.org>
> ---
>
> v5->v6:
>  - fix compile error(implicit declaration of function 'lru_gen_distance')
>    when CONFIG_LRU_GEN is disable.

Did you build-test it this time? I don't think LRU_REFS_FLAGS is
defined when CONFIG_LRU_GEN=y.



>  - rename 'is_retried' to is_retrying suggested by Barry Song.
>
> v5: https://lore.kernel.org/linux-kernel/CAGsJ_4x3Aj7wieK1FQKQC4Vbz5N+1dExs=Q70KQt-whS1dMxpw@mail.gmail.com/
>
>  include/linux/mm_inline.h |   5 ++
>  mm/vmscan.c               | 108 ++++++++++++++++++++++++--------------
>  2 files changed, 75 insertions(+), 38 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ