[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7ia47c3r1sb0.fsf@castle.c.googlers.com>
Date: Thu, 10 Apr 2025 23:59:47 +0000
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Johannes Weiner
<hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>, Muchun Song
<muchun.song@...ux.dev>, Yosry Ahmed <yosry.ahmed@...ux.dev>, Waiman
Long <llong@...hat.com>, linux-mm@...ck.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Meta kernel team <kernel-team@...a.com>
Subject: Re: [PATCH] memcg: no refill for offlined objcg
Shakeel Butt <shakeel.butt@...ux.dev> writes:
> In our fleet, we are observing refill_obj_stock() spending a lot of cpu
> in obj_cgroup_get() and on further inspection it seems like the given
> objcg is offlined and the kernel has to take the slow path i.e. atomic
> operations for objcg reference counting.
>
> Other than expensive atomic operations, refilling stock of an offlined
> objcg is a waster as there will not be new allocations for the offlined
> objcg. In addition, refilling triggers flush of the previous objcg which
> might be used in future. So, let's just avoid refilling the stock with
> the offlined objcg.
Hm, but on the other side if there are multiple uncharges in a row,
refilling obj stocks might be still cheaper?
In general I think that switching to atomic css refcnt on memcg
offlining is a mistake - it makes memory reclaim generally more
expensive. We can simple delay it until the approximate refcnt
number reaches some low value, e.g. 100 objects.
Powered by blists - more mailing lists