mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ridong Chen <ridong.chen@linux.dev>
To: Barry Song <baohua@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	Muchun Song <muchun.song@linux.dev>,
	Kairui Song <kasong@tencent.com>, Qi Zheng <qi.zheng@linux.dev>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Chris Down <chris@chrisdown.name>, Tejun Heo <tj@kernel.org>,
	Yu Zhao <yuzhao@google.com>,
	"open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)"
	<cgroups@vger.kernel.org>,
	"open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)"
	<linux-mm@kvack.org>,
	linux-kernel@vger.kernel.org, Ridong Chen <chenridong@xiaomi.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mm/mglru: fix ineffective memory protection for non-kswapd reclaim
Date: Sun, 30 Aug 2026 18:56:53 +0800	[thread overview]
Message-ID: <b9494f20-9ec0-45fc-830a-1bc2f92ecff2@linux.dev> (raw)
In-Reply-To: <CAGsJ_4wvYNV2UMaFW0a3Fb9U09v6bPfXyg4Rzw4B27xo-NVYbw@mail.gmail.com>



On 8/30/2026 6:40 PM, Barry Song wrote:
> On Sun, Aug 30, 2026 at 6:13 PM Ridong Chen <ridong.chen@linux.dev> wrote:
>>
>>
>>
>> On 8/30/2026 3:53 PM, Barry Song wrote:
>>> On Fri, Aug 28, 2026 at 7:10 PM Ridong Chen <ridong.chen@linux.dev> wrote:
>>>>
>>>> From: Ridong Chen <chenridong@xiaomi.com>
>>>>
>>>> memory.min/low is silently bypassed for MGLRU during global proactive
>>>> reclaim (writing to the root memory.reclaim) and global direct reclaim.
>>>
>>> I guess nobody is silently bypassing anything. It's just that the
>>> effective min is stale data. If kswapd has run at least once, should
>>> the protection have been updated already?
>>> I guess we need to update the changelog a bit?
>>>
>>
>> The children's emin/elow are derived from the parent's min/low settings and
>> children_min_usage, both of which can change over time. As a result, emin/elow
>> may become stale, even if kswapd has already run once.
> 
> right, let's just say this in changelog, we are *not* bypassing we are
> just checking
> against stable data. The current changelog seems to be misleading.
> 

Thanks, Will update.

> [...]
>>>> +void mem_cgroup_protection_path(struct mem_cgroup *root,
>>>> +                               struct mem_cgroup *memcg)
>>>
>>> Can we rename it to `mem_cgroup_calculate_protection_path()`?
>>>
>>> BTW, I see that the only caller is in vmscan and it passes NULL as
>>> `root`. Do we need to keep the `root` argument if the new helper is
>>> only used for global reclaim?
>>>
>> I'd suggest keeping it as is. This function updates protection along the path
>> from root to memcg, and could be reused later. Note that
>> mem_cgroup_calculate_protection() assumes the caller has already performed the
>> top-down walk, each level's calculation depends on its parent being updated first.
>>
>> For mem_cgroup_calculate_protection_path(), it can be called in any context
>> without such a precondition.
> 
> I am fine with this -  keeping the root there. but I guess rename is worth it.
> 

Yeah, I will rename in the next version.

-- 
Best regards
Ridong


      reply	other threads:[~2026-08-30 10:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 11:09 [PATCH v2 0/2] " Ridong Chen
2026-08-28 11:09 ` [PATCH v2 1/2] mm/page_counter: avoid integer overflow in effective_protection() Ridong Chen
2026-08-30  7:59   ` Barry Song
2026-08-28 11:09 ` [PATCH v2 2/2] mm/mglru: fix ineffective memory protection for non-kswapd reclaim Ridong Chen
2026-08-30  7:53   ` Barry Song
2026-08-30 10:13     ` Ridong Chen
2026-08-30 10:40       ` Barry Song
2026-08-30 10:56         ` Ridong Chen [this message]

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=b9494f20-9ec0-45fc-830a-1bc2f92ecff2@linux.dev \
    --to=ridong.chen@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=chenridong@xiaomi.com \
    --cc=chris@chrisdown.name \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=qi.zheng@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --cc=yuzhao@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®