From: Waiman Long <llong@redhat.com>
To: Roman Gushchin <guro@fb.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
linux-mm@kvack.org, Shakeel Butt <shakeelb@google.com>,
Muchun Song <songmuchun@bytedance.com>
Subject: Re: [PATCH 1/3] mm, memcg: Don't put offlined memcg into local stock
Date: Fri, 1 Oct 2021 21:54:14 -0400 [thread overview]
Message-ID: <6296d44d-a728-973a-0fc3-b5e30a09f920@redhat.com> (raw)
In-Reply-To: <YVefHLo1+6lgw3aB@carbon.dhcp.thefacebook.com>
On 10/1/21 7:51 PM, Roman Gushchin wrote:
> On Fri, Oct 01, 2021 at 03:09:36PM -0400, Waiman Long wrote:
>> When freeing a page associated with an offlined memcg, refill_stock()
>> 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.
> Hi Waiman!
>
> 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.
I am debugging a problem where some dying memcgs somehow stay around for
a long time leading to gradual increase in memory consumption over time.
I see the per-cpu stock as one of the places where a reference to a
dying memcg may be present. Anyway, I agree that it may not help much. I
am going to drop it if you think it is not a good idea.
Cheers,
Longman
next prev parent reply other threads:[~2021-10-02 1:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 19:09 [PATCH 0/3] mm, memcg: Miscellaneous cleanups Waiman Long
2021-10-01 19:09 ` [PATCH 1/3] mm, memcg: Don't put offlined memcg into local stock Waiman Long
2021-10-01 21:17 ` kernel test robot
2021-10-01 23:06 ` kernel test robot
2021-10-01 23:51 ` Roman Gushchin
2021-10-02 1:54 ` Waiman Long [this message]
2022-01-31 3:55 ` Waiman Long
2022-01-31 17:01 ` Roman Gushchin
2022-01-31 17:09 ` Waiman Long
2022-01-31 17:15 ` Waiman Long
2022-01-31 17:19 ` Roman Gushchin
2022-01-31 17:25 ` Waiman Long
2022-01-31 18:00 ` Shakeel Butt
2022-01-31 17:15 ` Roman Gushchin
2021-10-01 19:09 ` [PATCH 2/3] mm, memcg: Remove obsolete memcg_free_kmem() Waiman Long
2021-10-02 0:01 ` Roman Gushchin
2021-10-02 2:03 ` Waiman Long
2021-10-01 19:09 ` [PATCH 3/3] mm, memcg: Ensure valid memcg from objcg within a RCU critical section Waiman Long
2021-10-01 20:24 ` Shakeel Butt
2021-10-01 20:34 ` Waiman Long
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=6296d44d-a728-973a-0fc3-b5e30a09f920@redhat.com \
--to=llong@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=shakeelb@google.com \
--cc=songmuchun@bytedance.com \
--cc=vbabka@suse.cz \
--cc=vdavydov.dev@gmail.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