linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yuzhao@google.com>
To: kernel test robot <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	Kairui Song <kasong@tencent.com>,
	Kalesh Singh <kaleshsingh@google.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm-unstable v3 6/6] mm/mglru: rework workingset protection
Date: Tue, 24 Dec 2024 12:04:44 -0700	[thread overview]
Message-ID: <Z2sFzKmHPI0kI_fq@google.com> (raw)
In-Reply-To: <202412231601.f1eb8f84-lkp@intel.com>

On Mon, Dec 23, 2024 at 04:44:44PM +0800, kernel test robot wrote:
> 
> 
> Hello,
> 
> kernel test robot noticed a 5.7% regression of will-it-scale.per_process_ops on:

Thanks, Oliver!

> commit: 3b7734aa8458b62ecbfd785ca7918e831565006e ("[PATCH mm-unstable v3 6/6] mm/mglru: rework workingset protection")
> url: https://github.com/intel-lab-lkp/linux/commits/Yu-Zhao/mm-mglru-clean-up-workingset/20241208-061714
> base: v6.13-rc1
> patch link: https://lore.kernel.org/all/20241207221522.2250311-7-yuzhao@google.com/
> patch subject: [PATCH mm-unstable v3 6/6] mm/mglru: rework workingset protection
> 
> testcase: will-it-scale
> config: x86_64-rhel-9.4
> compiler: gcc-12
> test machine: 104 threads 2 sockets (Skylake) with 192G memory
> parameters:
> 
> 	nr_task: 100%
> 	mode: process
> 	test: pread2
> 	cpufreq_governor: performance

I think this is very likely caused by my change to folio_mark_accessed()
that unncessarily dirties cache lines shared between different cores.

Could you try the following fix please?

diff --git a/mm/swap.c b/mm/swap.c
index 062c8565b899..54bce14fef30 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -395,7 +395,8 @@ static void lru_gen_inc_refs(struct folio *folio)
 
 	do {
 		if ((old_flags & LRU_REFS_MASK) == LRU_REFS_MASK) {
-			folio_set_workingset(folio);
+			if (!folio_test_workingset(folio))
+				folio_set_workingset(folio);
 			return;
 		}
 


  reply	other threads:[~2024-12-24 19:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 22:15 [PATCH mm-unstable v3 0/6] mm/mglru: performance optimizations Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 1/6] mm/mglru: clean up workingset Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 2/6] mm/mglru: optimize deactivation Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 3/6] mm/mglru: rework aging feedback Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 4/6] mm/mglru: rework type selection Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 5/6] mm/mglru: rework refault detection Yu Zhao
2024-12-07 22:15 ` [PATCH mm-unstable v3 6/6] mm/mglru: rework workingset protection Yu Zhao
2024-12-23  8:44   ` kernel test robot
2024-12-24 19:04     ` Yu Zhao [this message]
2024-12-26  2:51       ` Oliver Sang

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=Z2sFzKmHPI0kI_fq@google.com \
    --to=yuzhao@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kaleshsingh@google.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    /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