public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
Cc: Wei Yang
	<richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	guro-b10kYP2dOMg@public.gmane.org,
	vbabka-AlSwsSmVLrQ@public.gmane.org,
	willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org,
	shy828301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	surenb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH 1/4] mm/memcg: use NUMA_NO_NODE to indicate allocation from unspecified node
Date: Sat, 15 Jan 2022 22:10:23 +0000	[thread overview]
Message-ID: <20220115221023.qndjlehjxdrj5r6b@master> (raw)
In-Reply-To: <YeE5k79uP3xBPCv7-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

On Fri, Jan 14, 2022 at 09:51:31AM +0100, Michal Hocko wrote:
>On Fri 14-01-22 00:29:37, Wei Yang wrote:
>> On Wed, Jan 12, 2022 at 09:56:15AM +0100, Michal Hocko wrote:
>> >On Wed 12-01-22 00:46:34, Wei Yang wrote:
>> >> On Tue, Jan 11, 2022 at 09:40:20AM +0100, Michal Hocko wrote:
>> >> >On Tue 11-01-22 01:02:59, Wei Yang wrote:
>> >> >> Instead of use "-1", let's use NUMA_NO_NODE for consistency.
>> >> >> 
>> >> >> Signed-off-by: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >> >
>> >> >I am not really sure this is worth it. After the merge window I plan to
>> >> >post http://lkml.kernel.org/r/20211214100732.26335-1-mhocko-DgEjT+Ai2yi4UlQgPVntAg@public.gmane.org
>> >> 
>> >> Give me some time to understand it :-)
>> >
>> >Just for the record, here is what I have put on top of that series:
>> 
>> Ok, I got what you try to resolve. I am ok with the following change except
>> one point.
>> 
>> >--- 
>> >>From b7195eba02fe6308a6927450f4630057c05e808e Mon Sep 17 00:00:00 2001
>> >From: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >Date: Tue, 11 Jan 2022 09:45:25 +0100
>> >Subject: [PATCH] memcg: do not tweak node in alloc_mem_cgroup_per_node_info
>> >
>> >alloc_mem_cgroup_per_node_info is allocated for each possible node and
>> >this used to be a problem because not !node_online nodes didn't have
>> >appropriate data structure allocated. This has changed by "mm: handle
>> >uninitialized numa nodes gracefully" so we can drop the special casing
>> >here.
>> >
>> >Signed-off-by: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >Signed-off-by: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
>> >---
>> > mm/memcontrol.c | 14 ++------------
>> > 1 file changed, 2 insertions(+), 12 deletions(-)
>> >
>> >diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> >index 781605e92015..ed19a21ee14e 100644
>> >--- a/mm/memcontrol.c
>> >+++ b/mm/memcontrol.c
>> >@@ -5044,18 +5044,8 @@ struct mem_cgroup *mem_cgroup_from_id(unsigned short id)
>> > static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
>> > {
>> > 	struct mem_cgroup_per_node *pn;
>> >-	int tmp = node;
>> >-	/*
>> >-	 * This routine is called against possible nodes.
>> >-	 * But it's BUG to call kmalloc() against offline node.
>> >-	 *
>> >-	 * TODO: this routine can waste much memory for nodes which will
>> >-	 *       never be onlined. It's better to use memory hotplug callback
>> >-	 *       function.
>> >-	 */
>> 
>> Do you think this TODO is not related to this change?
>
>It is not really related but I am not sure how useful it is. Essentially
>any allocation that is per-possible node is in the same situation and if
>we really need to deal with large and sparse possible nodes masks.
>

Sounds reasonable :-)

>If you want me to keep the TODO I will do it though.
>
>-- 
>Michal Hocko
>SUSE Labs

-- 
Wei Yang
Help you, Help me

  parent reply	other threads:[~2022-01-15 22:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11  1:02 [PATCH 1/4] mm/memcg: use NUMA_NO_NODE to indicate allocation from unspecified node Wei Yang
2022-01-11  1:03 ` [PATCH 2/4] mm/memcg: mem_cgroup_per_node is already set to 0 on allocation Wei Yang
     [not found]   ` <20220111010302.8864-2-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-01-11  2:25     ` Muchun Song
2022-01-11 18:06     ` Roman Gushchin
2022-01-16 19:24     ` Shakeel Butt
2022-01-11  8:41   ` Michal Hocko
2022-01-14 11:08   ` Mike Rapoport
     [not found] ` <20220111010302.8864-1-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-01-11  1:03   ` [PATCH 3/4] mm/memcg: retrieve parent memcg from css.parent Wei Yang
2022-01-11  8:43     ` Michal Hocko
     [not found]     ` <20220111010302.8864-3-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-01-11  3:12       ` Muchun Song
2022-01-11 18:09       ` Roman Gushchin
     [not found]         ` <Yd3H8Hea6dBlkzeW-cx5fftMpWqeCjSd+JxjunQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2022-01-12  0:24           ` Wei Yang
2022-01-16 19:54       ` Shakeel Butt
2022-01-11  1:03   ` [PATCH 4/4] mm/memcg: refine mem_cgroup_threshold_ary->current_threshold calculation Wei Yang
2022-01-11  8:44     ` Michal Hocko
     [not found]     ` <20220111010302.8864-4-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-01-11 18:23       ` Roman Gushchin
     [not found]         ` <Yd3LLalWzPy17PmR-cx5fftMpWqeCjSd+JxjunQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2022-01-12  0:25           ` Wei Yang
2022-01-11  2:23   ` [PATCH 1/4] mm/memcg: use NUMA_NO_NODE to indicate allocation from unspecified node Muchun Song
2022-01-11  8:40   ` Michal Hocko
     [not found]     ` <Yd1CdJA5NelzoK1D-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-01-12  0:46       ` Wei Yang
2022-01-12  8:56         ` Michal Hocko
     [not found]           ` <Yd6Xr7K9bKGVgGtI-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-01-14  0:29             ` Wei Yang
2022-01-14  8:51               ` Michal Hocko
     [not found]                 ` <YeE5k79uP3xBPCv7-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-01-15 22:10                   ` Wei Yang [this message]
2022-01-16 19:23             ` Shakeel Butt
2022-01-11 18:05   ` Roman Gushchin
2022-01-14 11:07   ` Mike Rapoport
2022-01-31  1:47 ` Wei Yang
2022-01-31 22:36   ` Andrew Morton
     [not found]     ` <20220131143620.b619f24f5246b26bce2b717d-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2022-02-01  0:42       ` Wei Yang

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=20220115221023.qndjlehjxdrj5r6b@master \
    --to=richard.weiyang-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=guro-b10kYP2dOMg@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-IBi9RG/b67k@public.gmane.org \
    --cc=shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=shy828301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    --cc=surenb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=vbabka-AlSwsSmVLrQ@public.gmane.org \
    --cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    /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