linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: lipeifeng@oppo.com
To: lipeifeng@oppo.com, 21cnbao@gmail.com, akpm@linux-foundation.org,
	david@redhat.com, osalvador@suse.de, willy@infradead.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] reclaim contended folios asynchronously instead of promoting them
Date: Fri,  8 Mar 2024 11:11:24 +0800	[thread overview]
Message-ID: <20240308031126.750-1-lipeifeng@oppo.com> (raw)

From: Peifeng Li <lipeifeng@oppo.com>

Commit 6d4675e60135 ("mm: don't be stuck to rmap lock on reclaim path")
prevents the reclaim path from becoming stuck on the rmap lock. However,
it reinserts those folios at the head of the LRU during shrink_folio_list,
even if those folios are very cold.

This can have a detrimental effect on performance by increasing refaults
and the likelihood of OOM (Out of Memory) killing.

This patchset introduces a new kthread:kshrinkd thread to asynchronously
reclaim contended folios rather than promoting them, thereby preventing
excessive violations of LRU rules. We observed a noticeable decrease in
refaults and OOM killing as a result.

-v2:
  * rewrite the commit messages;
  * rebase on top of mm-unstable
-v1:
  https://lore.kernel.org/linux-mm/20240219141703.3851-1-lipeifeng@oppo.com/

Peifeng Li (2):
  mm/rmap: provide folio_referenced with the options to try_lock or lock
  mm: vmscan: reclaim contended folios asynchronously instead of
    promoting them

 include/linux/mmzone.h        |   6 +
 include/linux/rmap.h          |   5 +-
 include/linux/swap.h          |   3 +
 include/linux/vm_event_item.h |   2 +
 mm/memory_hotplug.c           |   2 +
 mm/rmap.c                     |   5 +-
 mm/vmscan.c                   | 205 +++++++++++++++++++++++++++++++++-
 mm/vmstat.c                   |   2 +
 8 files changed, 221 insertions(+), 9 deletions(-)

-- 
2.34.1



             reply	other threads:[~2024-03-08  3:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08  3:11 lipeifeng [this message]
2024-03-08  3:11 ` [PATCH v2 1/2] mm/rmap: provide folio_referenced with the options to try_lock or lock lipeifeng
2024-03-08  3:11 ` [PATCH v2 2/2] mm: vmscan: reclaim contended folios asynchronously instead of promoting them lipeifeng
2024-03-08  4:56 ` [PATCH v2 0/2] " Matthew Wilcox
2024-03-08  6:41   ` 李培锋
2024-03-11 11:14     ` 李培锋
2024-03-12  9:22     ` 李培锋

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=20240308031126.750-1-lipeifeng@oppo.com \
    --to=lipeifeng@oppo.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).