All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kairui Song" <kasong@tencent.com>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH v4 11/17] mm/madvise: adapt for LRU refs based operations for MGLRU
Date: Thu, 15 Oct 2026 18:25:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-173284@kernel.org> (raw)
In-Reply-To: <20261016-mglru-fg-v4-11-2106750c0bfa@tencent.com>

> From: Kairui Song <kasong@tencent.com>
> 
> For the active/inactive LRU, madvise clears PG_referenced so that one more
> access is not enough to reactivate a folio, and keeps PG_workingset on a
> folio demoted out of the active list so its refault is still accounted as
> a workingset refault (PSI).
> 
> MGLRU keeps that history in the folio's refs count instead, which now
> lives in PG_referenced, PG_workingset and LRU_REFS_MASK, so writing to
> those bits directly corrupts the count. The two hints want different
> things:
> 
> - MADV_COLD resets the count in folio_deactivate(), which also moves the
>   folio to the oldest generation.
> - MADV_PAGEOUT caps the count at LRU_REFS_WORKINGSET before handing the
>   folio to reclaim_pages(). The hint marks the folio as cold, so the
>   eviction shadow records the capped count and does not inflate the
>   eviction/refault counters of the hot tiers that drive aging, while
>   folios at or above the workingset threshold keep their PSI
>   classification.
> 
> PG_young is cleared for both LRUs as before, so the referenced walk does
> not count stale history as a recent access.
> 
> Signed-off-by: Kairui Song <kasong@tencent.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-mglru-fg-v4-0-2106750c0bfa@tencent.com?part=11


  reply	other threads:[~2026-10-15 18:25 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 18:15 [PATCH v4 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) and flag cleanup Kairui Song via B4 Relay
2026-10-15 18:15 ` Kairui Song
2026-10-15 18:15 ` [PATCH v4 01/17] mm/memcontrol: allow update of LRU statistic without holding LRU lock Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:32   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 02/17] mm/mglru: make generation page counters atomic Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:37   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 03/17] mm/memcg: add folio-based lruvec live helper Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:31   ` sashiko-bot
2026-10-15 19:11   ` Harry Yoo
2026-10-15 18:15 ` [PATCH v4 04/17] mm/mglru: frequency guided workingset promotion (MGLRU-FG) Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:41   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 05/17] mm/mglru: make folio lru referenced times count a generic API Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:30   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 06/17] mm/mglru: move add/del LRU size accounting out of lru_gen_update_size() Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:28   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 07/17] mm/mglru, gup: mark folios referenced via a fast helper Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:27   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 08/17] mm/mglru, smaps: convert to LRU refs based operations for MGLRU Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:29   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 09/17] mm/damon: " Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:27   ` sashiko-bot
2026-10-15 18:15 ` [PATCH v4 10/17] mm/khugepaged: " Kairui Song via B4 Relay
2026-10-15 18:15   ` Kairui Song
2026-10-15 18:29   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 11/17] mm/madvise: adapt for " Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:25   ` sashiko-bot [this message]
2026-10-15 18:16 ` [PATCH v4 12/17] mm/huge_memory: mark folio as accessed more accurately on split Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:36   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 13/17] mm/mglru: folio LRU refs based active/inactive number accounting Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:34   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 14/17] mm/mglru: reparent folios from all generations Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:27   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 15/17] mm/mglru: make folio_inc_lru_refs lruvec lockless Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:29   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 16/17] mm/mglru: make folio_test_workingset() work based on folio LRU refs Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:35   ` sashiko-bot
2026-10-15 18:16 ` [PATCH v4 17/17] Documentation/mm: multi-gen LRU: update for frequency guided promotion Kairui Song via B4 Relay
2026-10-15 18:16   ` Kairui Song
2026-10-15 18:27   ` sashiko-bot

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=sashiko-outbox-173284@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=kasong@tencent.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.