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 v5 04/17] mm/memcg: add folio-based lruvec live helper
Date: Wed, 18 Nov 2026 21:12:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-221979@kernel.org> (raw)
In-Reply-To: <20261119-mglru-fg-v5-4-9eee2fe97a2d@tencent.com>

> From: Kairui Song <kasong@tencent.com>
> 
> Add a helper that resolves a live lruvec for a folio under RCU
> without taking the lruvec lock.  It takes a folio directly so the
> lruvec lookup happens inside the RCU read-side critical section,
> which a lruvec-based interface cannot guarantee.  The first user is
> the lockless folio_inc_lru_refs() path later in the series.
> 
> Factor the ancestor walk out of lruvec_live_lock_irq() into
> __lruvec_get_live(), so that both entry points share it, and spell
> out why the walk is enough while only the RCU read lock is held:
> reparenting of a memcg that starts dying waits for a grace period,
> so it cannot race with the caller until the lock is released.
> 
> Move memcg_is_dying() up in memcontrol.h, next to the other memcg state
> predicates, and use it for the walk rather than repeating the open coded
> css_is_dying() test a few definitions away from where it is explained.
> 
> No functional change for existing callers.
> 
> Tested-by: Zhao Zhenzhuo <zhaozhengzhuo@uniontech.com>
> Signed-off-by: Kairui Song <kasong@tencent.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-mglru-fg-v5-0-9eee2fe97a2d@tencent.com?part=4


  reply	other threads:[~2026-11-18 21:12 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 21:03 [PATCH v5 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) and flag cleanup Kairui Song
2026-11-18 21:03 ` Kairui Song via B4 Relay
2026-11-18 21:03 ` [PATCH v5 01/17] mm/mglru: rename the generation offset in lru_gen_folio_seq() Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:06   ` sashiko-bot
2026-11-18 23:48   ` Barry Song
2026-11-19  0:27   ` Ridong Chen
2026-11-19  2:45   ` lianux.mm
2026-11-20  6:46   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 02/17] mm/memcontrol: allow update of LRU statistic without holding LRU lock Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:12   ` sashiko-bot
2026-11-19 19:43   ` Barry Song
2026-11-20  6:48   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 03/17] mm/mglru: make generation page counters atomic Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:12   ` sashiko-bot
2026-11-19 19:44   ` Barry Song
2026-11-20  6:49   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 04/17] mm/memcg: add folio-based lruvec live helper Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:12   ` sashiko-bot [this message]
2026-11-20  6:52   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 05/17] mm/mglru: skip the flags cmpxchg when nothing changes Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:08   ` sashiko-bot
2026-11-20  6:53   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 06/17] mm/mglru: frequency guided workingset promotion (MGLRU-FG) Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:29   ` sashiko-bot
2026-11-20  8:09   ` KunWu Chan
2026-11-20  9:35     ` Kairui Song
2026-11-20 16:20       ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 07/17] mm/mglru: make folio lru referenced times count a generic API Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:11   ` sashiko-bot
2026-11-20  8:17   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 08/17] mm/mglru: move add/del LRU size accounting out of lru_gen_update_size() Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:07   ` sashiko-bot
2026-11-20  8:20   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 09/17] mm/mglru, gup: mark folios referenced via a fast helper Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:09   ` sashiko-bot
2026-11-20  8:20   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 10/17] mm/mglru, smaps: convert to LRU refs based operations for MGLRU Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:10   ` sashiko-bot
2026-11-20  8:21   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 11/17] mm/damon: " Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:08   ` sashiko-bot
2026-11-20  8:21   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 12/17] mm/khugepaged: " Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:10   ` sashiko-bot
2026-11-20  8:21   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 13/17] mm/madvise: adapt for " Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:14   ` sashiko-bot
2026-11-20  8:35   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 14/17] mm/huge_memory: mark folio as accessed more accurately on split Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:12   ` sashiko-bot
2026-11-20  8:36   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 15/17] mm/mglru: folio LRU refs based active/inactive number accounting Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:29   ` sashiko-bot
2026-11-19  2:33     ` Kairui Song
2026-11-20  9:29   ` KunWu Chan
2026-11-20 11:21     ` Kairui Song
2026-11-20 16:30       ` KunWu Chan
2026-11-20 18:58         ` Kairui Song
2026-11-18 21:03 ` [PATCH v5 16/17] mm/mglru: make folio_inc_lru_refs lruvec lockless Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:22   ` sashiko-bot
2026-11-20  9:41   ` KunWu Chan
2026-11-18 21:03 ` [PATCH v5 17/17] mm/mglru: make folio_test_workingset() work based on folio LRU refs Kairui Song
2026-11-18 21:03   ` Kairui Song via B4 Relay
2026-11-18 21:20   ` sashiko-bot
2026-11-20  9:53   ` KunWu Chan
2026-11-19  5:13 ` [PATCH v5 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) and flag cleanup Lian Wang
2026-11-19 11:23 ` [PATCH v5 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) Tianyi Chen
2026-11-19 17:33   ` Kairui Song
2026-11-20 10:32     ` Tianyi Chen
2026-11-19 23:40 ` [PATCH v5 00/17] mm/mglru: frequency guided promotion (MGLRU-FG) and flag cleanup Andrew Morton
2026-11-19 23:52   ` Barry Song
2026-11-20 11:16   ` Kairui Song

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-221979@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.