From: Johannes Weiner <hannes@cmpxchg.org>
To: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: akpm@linux-foundation.org, minchan@kernel.org,
quic_pkondeti@quicinc.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Suren Baghdasaryan <surenb@google.com>
Subject: Re: [PATCH] mm: madvise: fix uneven accounting of psi
Date: Wed, 31 May 2023 18:19:55 -0400 [thread overview]
Message-ID: <20230531221955.GD102494@cmpxchg.org> (raw)
In-Reply-To: <1685531374-6091-1-git-send-email-quic_charante@quicinc.com>
On Wed, May 31, 2023 at 04:39:34PM +0530, Charan Teja Kalla wrote:
> This patch is tested on Android, Snapdragon SoC with 8Gb RAM, 4GB swap
> mounted on zram which has 2GB of backingdev. The test case involved
> launching some memory hungry apps in an order and do the proactive
> reclaim for the app that went to background using madvise(MADV_PAGEOUT).
> We are seeing ~40% less total values of psi mem some and full when this
> patch is combined with [1].
Does that mean those pages are thrashing, but because you clear their
workingset it isn't detected and reported via psi?
I don't rally get why silencing the thrashing is an improvement.
> [1]https://lore.kernel.org/all/20220214214921.419687-1-hannes@cmpxchg.org/T/#u
>
> Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
> ---
> mm/madvise.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 340125d..3410c39 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -409,8 +409,10 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
> if (folio_isolate_lru(folio)) {
> if (folio_test_unevictable(folio))
> folio_putback_lru(folio);
> - else
> + else {
> + folio_clear_workingset(folio);
> list_add(&folio->lru, &folio_list);
> + }
> }
> } else
> folio_deactivate(folio);
> @@ -503,8 +505,10 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
> if (folio_isolate_lru(folio)) {
> if (folio_test_unevictable(folio))
> folio_putback_lru(folio);
> - else
> + else {
> + folio_clear_workingset(folio);
> list_add(&folio->lru, &folio_list);
> + }
> }
> } else
> folio_deactivate(folio);
> --
> 2.7.4
>
next prev parent reply other threads:[~2023-05-31 22:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 11:09 [PATCH] mm: madvise: fix uneven accounting of psi Charan Teja Kalla
2023-05-31 22:04 ` Andrew Morton
2023-06-01 13:18 ` Charan Teja Kalla
2023-05-31 22:19 ` Johannes Weiner [this message]
2023-06-01 13:07 ` Charan Teja Kalla
2023-06-05 18:00 ` Johannes Weiner
2023-06-06 14:53 ` Charan Teja Kalla
2023-06-06 19:48 ` Suren Baghdasaryan
2023-06-09 12:42 ` Charan Teja Kalla
2023-06-09 23:13 ` Suren Baghdasaryan
2023-06-12 13:40 ` Johannes Weiner
2023-06-26 14:31 ` Charan Teja Kalla
2023-06-27 22:50 ` Suren Baghdasaryan
2023-06-13 3:13 ` Pavan Kondeti
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=20230531221955.GD102494@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=quic_charante@quicinc.com \
--cc=quic_pkondeti@quicinc.com \
--cc=surenb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.