All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-25  6:18 ` Xiang Yang
  0 siblings, 0 replies; 8+ messages in thread
From: Xiang Yang @ 2022-06-25  6:18 UTC (permalink / raw)
  To: hannes, mhocko, roman.gushchin, shakeelb, songmuchun, akpm
  Cc: cgroups, linux-mm, linux-kernel, xiangyang3

mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
which is the same work in percpu.c and slab_common.c.

Signed-off-by: Xiang Yang <xiangyang3@huawei.com>
---
 mm/memcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 85adc43c5a25..4672c9ddd188 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3815,7 +3815,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
 #ifdef CONFIG_MEMCG_KMEM
 static int memcg_online_kmem(struct mem_cgroup *memcg)
 {
-	if (cgroup_memory_nokmem)
+	if (mem_cgroup_kmem_disabled())
 		return 0;
 
 	if (unlikely(mem_cgroup_is_root(memcg)))
@@ -3830,7 +3830,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
 
 static void memcg_offline_kmem(struct mem_cgroup *memcg)
 {
-	if (cgroup_memory_nokmem)
+	if (mem_cgroup_kmem_disabled())
 		return;
 
 	if (unlikely(mem_cgroup_is_root(memcg)))
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-25  6:18 ` Xiang Yang
  0 siblings, 0 replies; 8+ messages in thread
From: Xiang Yang @ 2022-06-25  6:18 UTC (permalink / raw)
  To: hannes-druUgvl0LCNAfugRpC6u6w, mhocko-DgEjT+Ai2ygdnm+yROfE0A,
	roman.gushchin-fxUVXftIFDnyG1zEObXtfA,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA,
	songmuchun-EC8Uxl6Npydl57MIdRCFDg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	xiangyang3-hv44wF8Li93QT0dZR+AlfA

mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
which is the same work in percpu.c and slab_common.c.

Signed-off-by: Xiang Yang <xiangyang3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 mm/memcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 85adc43c5a25..4672c9ddd188 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3815,7 +3815,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
 #ifdef CONFIG_MEMCG_KMEM
 static int memcg_online_kmem(struct mem_cgroup *memcg)
 {
-	if (cgroup_memory_nokmem)
+	if (mem_cgroup_kmem_disabled())
 		return 0;
 
 	if (unlikely(mem_cgroup_is_root(memcg)))
@@ -3830,7 +3830,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
 
 static void memcg_offline_kmem(struct mem_cgroup *memcg)
 {
-	if (cgroup_memory_nokmem)
+	if (mem_cgroup_kmem_disabled())
 		return;
 
 	if (unlikely(mem_cgroup_is_root(memcg)))
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-25  8:58   ` Muchun Song
  0 siblings, 0 replies; 8+ messages in thread
From: Muchun Song @ 2022-06-25  8:58 UTC (permalink / raw)
  To: Xiang Yang
  Cc: hannes, mhocko, roman.gushchin, shakeelb, akpm, cgroups,
	linux-mm, linux-kernel

On Sat, Jun 25, 2022 at 02:18:44PM +0800, Xiang Yang wrote:
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
> 
> Signed-off-by: Xiang Yang <xiangyang3@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-25  8:58   ` Muchun Song
  0 siblings, 0 replies; 8+ messages in thread
From: Muchun Song @ 2022-06-25  8:58 UTC (permalink / raw)
  To: Xiang Yang
  Cc: hannes-druUgvl0LCNAfugRpC6u6w, mhocko-DgEjT+Ai2ygdnm+yROfE0A,
	roman.gushchin-fxUVXftIFDnyG1zEObXtfA,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Sat, Jun 25, 2022 at 02:18:44PM +0800, Xiang Yang wrote:
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
> 
> Signed-off-by: Xiang Yang <xiangyang3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Reviewed-by: Muchun Song <songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-26  1:41   ` Roman Gushchin
  0 siblings, 0 replies; 8+ messages in thread
From: Roman Gushchin @ 2022-06-26  1:41 UTC (permalink / raw)
  To: Xiang Yang
  Cc: hannes, mhocko, shakeelb, songmuchun, akpm, cgroups, linux-mm,
	linux-kernel

On Sat, Jun 25, 2022 at 02:18:44PM +0800, Xiang Yang wrote:
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
> 
> Signed-off-by: Xiang Yang <xiangyang3@huawei.com>

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-26  1:41   ` Roman Gushchin
  0 siblings, 0 replies; 8+ messages in thread
From: Roman Gushchin @ 2022-06-26  1:41 UTC (permalink / raw)
  To: Xiang Yang
  Cc: hannes-druUgvl0LCNAfugRpC6u6w, mhocko-DgEjT+Ai2ygdnm+yROfE0A,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA,
	songmuchun-EC8Uxl6Npydl57MIdRCFDg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Sat, Jun 25, 2022 at 02:18:44PM +0800, Xiang Yang wrote:
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
> 
> Signed-off-by: Xiang Yang <xiangyang3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Acked-by: Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>

Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-27  1:05   ` Souptick Joarder
  0 siblings, 0 replies; 8+ messages in thread
From: Souptick Joarder @ 2022-06-27  1:05 UTC (permalink / raw)
  To: Xiang Yang
  Cc: Johannes Weiner, Michal Hocko, roman.gushchin, shakeelb,
	songmuchun, Andrew Morton, cgroups, Linux-MM, linux-kernel

On Sat, Jun 25, 2022 at 11:51 AM Xiang Yang <xiangyang3@huawei.com> wrote:
>
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
>
> Signed-off-by: Xiang Yang <xiangyang3@huawei.com>
Acked-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
> ---
>  mm/memcontrol.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 85adc43c5a25..4672c9ddd188 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3815,7 +3815,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
>  #ifdef CONFIG_MEMCG_KMEM
>  static int memcg_online_kmem(struct mem_cgroup *memcg)
>  {
> -       if (cgroup_memory_nokmem)
> +       if (mem_cgroup_kmem_disabled())
>                 return 0;
>
>         if (unlikely(mem_cgroup_is_root(memcg)))
> @@ -3830,7 +3830,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
>
>  static void memcg_offline_kmem(struct mem_cgroup *memcg)
>  {
> -       if (cgroup_memory_nokmem)
> +       if (mem_cgroup_kmem_disabled())
>                 return;
>
>         if (unlikely(mem_cgroup_is_root(memcg)))
> --
> 2.22.0
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
@ 2022-06-27  1:05   ` Souptick Joarder
  0 siblings, 0 replies; 8+ messages in thread
From: Souptick Joarder @ 2022-06-27  1:05 UTC (permalink / raw)
  To: Xiang Yang
  Cc: Johannes Weiner, Michal Hocko,
	roman.gushchin-fxUVXftIFDnyG1zEObXtfA,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA,
	songmuchun-EC8Uxl6Npydl57MIdRCFDg, Andrew Morton,
	cgroups-u79uwXL29TY76Z2rM5mHXA, Linux-MM,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Sat, Jun 25, 2022 at 11:51 AM Xiang Yang <xiangyang3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote:
>
> mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
> Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
> which is the same work in percpu.c and slab_common.c.
>
> Signed-off-by: Xiang Yang <xiangyang3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Acked-by: Souptick Joarder (HPE) <jrdr.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  mm/memcontrol.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 85adc43c5a25..4672c9ddd188 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3815,7 +3815,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
>  #ifdef CONFIG_MEMCG_KMEM
>  static int memcg_online_kmem(struct mem_cgroup *memcg)
>  {
> -       if (cgroup_memory_nokmem)
> +       if (mem_cgroup_kmem_disabled())
>                 return 0;
>
>         if (unlikely(mem_cgroup_is_root(memcg)))
> @@ -3830,7 +3830,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
>
>  static void memcg_offline_kmem(struct mem_cgroup *memcg)
>  {
> -       if (cgroup_memory_nokmem)
> +       if (mem_cgroup_kmem_disabled())
>                 return;
>
>         if (unlikely(mem_cgroup_is_root(memcg)))
> --
> 2.22.0
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-27  1:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25  6:18 [PATCH -next] mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled() Xiang Yang
2022-06-25  6:18 ` Xiang Yang
2022-06-25  8:58 ` Muchun Song
2022-06-25  8:58   ` Muchun Song
2022-06-26  1:41 ` Roman Gushchin
2022-06-26  1:41   ` Roman Gushchin
2022-06-27  1:05 ` Souptick Joarder
2022-06-27  1:05   ` Souptick Joarder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.