From: Qi Zheng <qi.zheng@linux.dev>
To: Johannes Weiner <hannes@cmpxchg.org>, shakeel.butt@linux.dev
Cc: Harry Yoo <harry@kernel.org>,
akpm@linux-foundation.org, david@kernel.org, kasong@tencent.com,
baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com,
weixugc@google.com, muchun.song@linux.dev,
peiyang_he@smail.nju.edu.cn, mhocko@kernel.org,
roman.gushchin@linux.dev, ljs@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Qi Zheng <zhengqi.arch@bytedance.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3] mm: mglru: fix stale batch updates after memcg reparenting
Date: Fri, 26 Jun 2026 19:21:28 +0800 [thread overview]
Message-ID: <57c18afd-e2a3-4b37-90b6-f2a4c758e8aa@linux.dev> (raw)
In-Reply-To: <aj5I7JAXWlTHRyEW@cmpxchg.org>
On 6/26/26 5:39 PM, Johannes Weiner wrote:
> On Fri, Jun 26, 2026 at 03:04:17PM +0800, Qi Zheng wrote:
>> On 6/26/26 2:48 PM, Harry Yoo wrote:
>>> On 6/26/26 3:24 PM, Qi Zheng wrote:
>>>> On 6/26/26 12:59 PM, Harry Yoo wrote:
>>>>> Observing a dying cgroup should be rare anyway, it's worth focusing
>>>>> more on readability?
>>>>
>>>> While it's rare to encounter consecutive dying memcgs, it can still
>>>> happen, right?
>>>
>>> But is worth saving a few instruction in a basic block that is
>>> unlikely() to be executed?
>>
>> I don't have a strong opinion here. Hi Johannes, I'll leave the decision
>> up to you. If necessary, I can send out the v4.
>
> Yes, I was thinking what Harry actually bothered to spell out ;)
>
> The race is rare, multiple levels even rarer, and even *then*
> mem_cgroup_lruvec() is a quick inline.
>
> This way you have one block to handle that one rare race
> condition. One place to put the comment. No labels, no goto.
>
> Simplicity wins :)
Okay, I will update it as you suggested and send out the v4.
Hi Shakeel, do we really need to move lock_batch_lruvec() to
memcontrol.h? It's currently only used by reset_batch_size().
Thanks,
Qi
next prev parent reply other threads:[~2026-06-26 11:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 15:15 [PATCH v3] mm: mglru: fix stale batch updates after memcg reparenting Qi Zheng
2026-06-25 18:41 ` Johannes Weiner
2026-06-26 2:27 ` Qi Zheng
2026-06-26 4:43 ` Harry Yoo
2026-06-26 4:48 ` Qi Zheng
2026-06-26 4:59 ` Harry Yoo
2026-06-26 6:24 ` Qi Zheng
2026-06-26 6:48 ` Harry Yoo
2026-06-26 7:04 ` Qi Zheng
2026-06-26 7:09 ` Harry Yoo
2026-06-26 9:39 ` Johannes Weiner
2026-06-26 11:21 ` Qi Zheng [this message]
2026-06-26 17:08 ` Shakeel Butt
2026-06-25 20:22 ` Shakeel Butt
2026-06-26 2:39 ` Qi Zheng
2026-06-26 4:29 ` Peiyang He
2026-06-26 4:50 ` Qi Zheng
2026-06-26 7:15 ` Harry Yoo
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=57c18afd-e2a3-4b37-90b6-f2a4c758e8aa@linux.dev \
--to=qi.zheng@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=harry@kernel.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=peiyang_he@smail.nju.edu.cn \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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