linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] mm/vmscan: Accumulate nr_demoted for accurate demotion statistics
Date: Fri, 10 Jan 2025 14:19:59 +0000	[thread overview]
Message-ID: <TY1PR01MB156211BD420E7E523762E467A51C2@TY1PR01MB1562.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <Z4EXbSq2Rov78WVF@localhost.localhost>

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

> It looks like demotion will only be attempted once. On the second pass,
do_demote_pass will be false, demote_folios will be empty and
demote_folio_list() will do nothing. But I guess there is no harm in
making nr_demoted  an accumulation for less confusion in the future...


Emm, after checked the code again, it seems you are right. But this can not explain why i got inaccurate demotion statistics from /proc/vmstat compared to the value i counted in the code myself days ago.

thanks for your feedback, i will take a look next week.

Get Outlook for Android<https://aka.ms/AAb9ysg>

________________________________
发件人: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
发送时间: 2025年1月10日星期五 20:50
收件人: Li, Zhijian/李 智坚
抄送: linux-mm@kvack.org; Andrew Morton; linux-kernel@vger.kernel.org
主题: Re: [PATCH 1/2] mm/vmscan: Accumulate nr_demoted for accurate demotion statistics

On Fri, Jan 10, 2025 at 08:21:32PM +0800, Li Zhijian wrote:
> In the shrink_folio_list() function, demote_folio_list() can be called
> multiple times, which can lead to inaccurate demotion statistics if the
> number of demoted pages is not accumulated correctly.

It looks like demotion will only be attempted once. On the second pass,
do_demote_pass will be false, demote_folios will be empty and
demote_folio_list() will do nothing. But I guess there is no harm in
making nr_demoted  an accumulation for less confusion in the future...


[-- Attachment #2: Type: text/html, Size: 2605 bytes --]

  reply	other threads:[~2025-01-10 14:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 12:21 Li Zhijian
2025-01-10 12:21 ` [PATCH 2/2] mm/vmscan: Fix pgdemote_* accounting with lru_gen_enabled Li Zhijian
2025-01-15 21:51   ` Yu Zhao
2025-01-10 12:49 ` [PATCH 1/2] mm/vmscan: Accumulate nr_demoted for accurate demotion statistics Kaiyang Zhao
2025-01-10 14:19   ` Zhijian Li (Fujitsu) [this message]
2025-01-10 14:24     ` Zhijian Li (Fujitsu)
2025-01-10 15:24       ` Kaiyang Zhao

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=TY1PR01MB156211BD420E7E523762E467A51C2@TY1PR01MB1562.jpnprd01.prod.outlook.com \
    --to=lizhijian@fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=kaiyang2@cs.cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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