On Fri, Oct 01, 2021 at 03:09:36PM -0400, Waiman Long wrote:
When freeing a page associated with an offlined memcg, refill_stock()Hi Waiman!
will put it into local stock delaying its demise until another memcg
comes in to take its place in the stock. To avoid that, we now check
for offlined memcg and go directly in this case to the slowpath for
the uncharge via the repurposed cancel_charge() function.
I'm afraid it can make a cleanup of a dying cgroup slower: for every
released page we'll potentially traverse the whole cgroup tree and
decrease atomic page counters.
I'm not sure I understand the benefits we get from this change which
do justify the slowdown on the cleanup path.