linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: 李培锋 <lipeifeng@oppo.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, david@redhat.com, osalvador@suse.de,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	v-songbaohua@oppo.com, gregkh@google.com, tkjos@google.com
Subject: Re: [PATCH 0/2] Support kshrinkd
Date: Tue, 20 Feb 2024 10:04:33 +0800	[thread overview]
Message-ID: <a642d9dc-6d48-016c-7007-c08ce8933d18@oppo.com> (raw)
In-Reply-To: <ZdOG-135dLP0IeU8@casper.infradead.org>


在 2024/2/20 0:51, Matthew Wilcox 写道:
> On Mon, Feb 19, 2024 at 10:17:01PM +0800, lipeifeng@oppo.com wrote:
>> 'commit 6d4675e60135 ("mm: don't be stuck to rmap lock on reclaim path")'
>> The above patch would avoid reclaim path to stuck rmap lock.
>> But it would cause some folios in LRU not sorted by aging because
>> the contended-folios in rmap_walk would be putbacked to the head of LRU
>> during shrink_folio_list even if the folios are very cold.
>>
>> The patchset setups new kthread:kshrinkd to reclaim the contended-folio
>> in rmap_walk when shrink_folio_list, to avoid to break the rules of LRU.
> Patch 1/2 didn't make it to my inbox or to lore.
Hi Sir, I had resent to you.
>   But you should talk
> about the real world consequences of this in the cover letter.  What do
> we observe if this problem happens?  How much extra performance will we
> gain by applying this patch?

Hi Sir:

Monkey-test in phone with 16G-ram for 300 hours shows that almost one-third

of the contended-pages can be freed successfully next time, putting back 
those

folios to LRU's head would break the rules of inative-LRU.

- pgsteal_kshrinkd 262577
- pgscan_kshrinkd 795503


"pgsteal_kshrinkd" means that the amount of those contended-folios which 
can be

freed successfully but be putbacked in the head of inactive-LRU, more 
than 1GB(262577 folios).

Mobile-phone with 16-ram, the total amount of inactive are around 4.5G, 
so that the

contended-folios would break the rules of inactive-LRU.

- nr_inactive_anon 1020953
- nr_inactive_file 204801


Actually, The patchset had been merged in Google kernel/common since

android12-5.10 and android13-5.15, and were taken in more than 100 millions

android-phone devices more than 1.5 years.

But for the reason of GKI, the patches were implemented in the form of 
hooks,

the patches merged in google-line as follows:

https://android-review.googlesource.com/c/kernel/common/+/2163904

https://android-review.googlesource.com/c/kernel/common/+/2191343

https://android-review.googlesource.com/c/kernel/common/+/2550490

https://android-review.googlesource.com/c/kernel/common/+/2318311




  reply	other threads:[~2024-02-20  2:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 14:17 lipeifeng
2024-02-19 14:17 ` [PATCH 2/2] mm: support kshrinkd lipeifeng
2024-02-20  2:11   ` 李培锋
2024-02-20  3:19     ` Barry Song
2024-02-19 16:51 ` [PATCH 0/2] Support kshrinkd Matthew Wilcox
2024-02-20  2:04   ` 李培锋 [this message]
2024-02-20  2:55     ` Matthew Wilcox
2024-02-20  4:14       ` 李培锋
     [not found] ` <20240219141703.3851-2-lipeifeng@oppo.com>
2024-02-20  1:42   ` [PATCH 1/2] mm/rmap: support folio_referenced to control if try_lock in rmap_walk 李培锋
2024-02-20  3:01     ` Barry Song
2024-02-20  4:00       ` 李培锋
2024-02-20  7:16         ` Barry Song
2024-02-20  2:09 ` [PATCH 0/2] Support kshrinkd 李培锋

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a642d9dc-6d48-016c-7007-c08ce8933d18@oppo.com \
    --to=lipeifeng@oppo.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=gregkh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=tkjos@google.com \
    --cc=v-songbaohua@oppo.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox