public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
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 2/3] mm, memcg: Remove obsolete memcg_free_kmem()
Date: Fri, 1 Oct 2021 22:03:05 -0400	[thread overview]
Message-ID: <b45fd235-a454-360e-4853-d41db3213e9d@redhat.com> (raw)
In-Reply-To: <YVehP18mCcsXmFy1@carbon.dhcp.thefacebook.com>

On 10/1/21 8:01 PM, Roman Gushchin wrote:
> On Fri, Oct 01, 2021 at 03:09:37PM -0400, Waiman Long wrote:
>> Since commit d648bcc7fe65 ("mm: kmem: make memcg_kmem_enabled()
>> irreversible"), the only thing memcg_free_kmem() does is to call
>> memcg_offline_kmem() when the memcg is still online. However,
>> memcg_offline_kmem() is only called from mem_cgroup_css_free() which
>> cannot be reached if the memcg hasn't been offlined first.
> Hm, is it true? What if online_css() fails?
I just realize that memcg_online_kmem() is called at css_create(). So 
yes, if css_online() fails (i.e. ENOMEM), we will need to do 
memcg_offline_kmem().
>> As this
>> function now serves no purpose, we should just remove it.
> It looks like we can just use memcg_offline_kmem() instead of
> memcg_free_kmem().

Right, memcg_free_kmem() isn't the right name for that. I agree that we 
should just change mem_cgroup_css_free() to call memcg_offline_kmem() 
directly. Will update the patch accordingly.

Thanks,
Longman


  reply	other threads:[~2021-10-02  2:03 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
     [not found] ` <20211001190938.14050-1-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-10-01 19:09   ` [PATCH 1/3] mm, memcg: Don't put offlined memcg into local stock Waiman Long
     [not found]     ` <20211001190938.14050-2-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-10-01 21:17       ` kernel test robot
2021-10-01 23:06       ` kernel test robot
2021-10-01 23:51       ` Roman Gushchin
     [not found]         ` <YVefHLo1+6lgw3aB-cx5fftMpWqeCjSd+JxjunQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2021-10-02  1:54           ` Waiman Long
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
     [not found]                   ` <c950a93d-bb70-9a97-dabe-a1d58d755dad-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-01-31 17:19                     ` Roman Gushchin
     [not found]                       ` <YfgaIcSJhqEOnh65-cx5fftMpWqeCjSd+JxjunQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2022-01-31 17:25                         ` Waiman Long
     [not found]                           ` <9abc9cb8-8734-90b0-c495-8df89c7bb579-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-01-31 18:00                             ` Shakeel Butt
     [not found]                 ` <95ba1931-e9c9-45c3-b080-d28f2ad368a7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-01-31 17:15                   ` Roman Gushchin
2021-10-01 19:09   ` [PATCH 2/3] mm, memcg: Remove obsolete memcg_free_kmem() Waiman Long
     [not found]     ` <20211001190938.14050-3-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-10-02  0:01       ` Roman Gushchin
2021-10-02  2:03         ` Waiman Long [this message]
2021-10-01 19:09   ` [PATCH 3/3] mm, memcg: Ensure valid memcg from objcg within a RCU critical section Waiman Long
     [not found]     ` <20211001190938.14050-4-longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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=b45fd235-a454-360e-4853-d41db3213e9d@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