[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <v4ihmnzafzwfgdbk6gcnl76bjqko2t4wdz3vy32vjuzffzzt6i@uxecpmupkqh3>
Date: Fri, 26 Sep 2025 09:36:57 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Qi Zheng <zhengqi.arch@...edance.com>
Cc: Zi Yan <ziy@...dia.com>, David Hildenbrand <david@...hat.com>,
hannes@...xchg.org, hughd@...gle.com, mhocko@...e.com, roman.gushchin@...ux.dev,
muchun.song@...ux.dev, lorenzo.stoakes@...cle.com, harry.yoo@...cle.com,
baolin.wang@...ux.alibaba.com, Liam.Howlett@...cle.com, npache@...hat.com, ryan.roberts@....com,
dev.jain@....com, baohua@...nel.org, lance.yang@...ux.dev,
akpm@...ux-foundation.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org
Subject: Re: [PATCH v2 4/4] mm: thp: reparent the split queue during memcg
offline
On Fri, Sep 26, 2025 at 02:57:39PM +0800, Qi Zheng wrote:
>
>
> On 9/26/25 6:35 AM, Shakeel Butt wrote:
[...]
> > >
> > > Yes, css_is_dying() can be used but please note that there is a rcu
> > > grace period between setting CSS_DYING and clearing CSS_ONLINE (i.e.
> > > reparenting deferred split queue) and during that period the deferred
> > > split THPs of the dying memcg will be hidden from shrinkers (which
> > > might be fine).
>
> My mistake, now I think using css_is_dying() is safe.
>
> >
> > BTW if this period is not acceptable and we don't want to add is_dying
> > to struct deferred_split, we can use something similar to what list_lru
> > does in the similar situation i.e. set a special value (LONG_MIN) in its
> > nr_items variable. That is make split_queue_len a long and set it to
> > LONG_MIN during memcg offlining/reparenting.
>
> I've considered this option, but I am concerned about the risk of
> overflow.
If you modify it only within a lock then why would it over or underflow?
>
> So I will try to use css_is_dying() in the next version.
No objection from me but add a comment on the potential window where the
deferred thps will be hidden from the shrinkers.
Powered by blists - more mailing lists