From: Michal Hocko <mhocko@kernel.org>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: David Hildenbrand <david@redhat.com>,
akpm@linux-foundation.org, hannes@cmpxchg.org,
shakeelb@google.com, vdavydov.dev@gmail.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: Allocate shrinker_map on appropriate NUMA node
Date: Fri, 31 Jan 2020 17:01:51 +0100 [thread overview]
Message-ID: <20200131160151.GB4520@dhcp22.suse.cz> (raw)
In-Reply-To: <a03cb815-8f80-03db-c1bd-39af960db601@virtuozzo.com>
On Fri 31-01-20 18:49:24, Kirill Tkhai wrote:
> On 31.01.2020 18:47, Michal Hocko wrote:
> > On Fri 31-01-20 18:00:51, Kirill Tkhai wrote:
> > [...]
> >> @@ -333,8 +333,9 @@ static int memcg_expand_one_shrinker_map(struct mem_cgroup *memcg,
> >> /* Not yet online memcg */
> >> if (!old)
> >> return 0;
> >> -
> >> - new = kvmalloc(sizeof(*new) + size, GFP_KERNEL);
> >> + /* See comment in alloc_mem_cgroup_per_node_info()*/
> >> + tmp = node_state(nid, N_NORMAL_MEMORY) ? nid : NUMA_NO_NODE;
> >> + new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, tmp);
> >> if (!new)
> >> return -ENOMEM;
> >
> > I do not think this is a good pattern to copy. Why cannot you simply use
> > kvmalloc_node with the given node? The allocator should fallback to the
> > closest node if the given one doesn't have any memory.
>
> Hm, why isn't the same scheme used in alloc_mem_cgroup_per_node_info() then?
Dunno, it's an old code. Probably worth cleaning up.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-01-31 16:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-31 12:09 [PATCH] mm: Allocate shrinker_map on appropriate NUMA node Kirill Tkhai
2020-01-31 14:57 ` David Hildenbrand
2020-01-31 15:00 ` [PATCH v2] " Kirill Tkhai
2020-01-31 15:47 ` Michal Hocko
2020-01-31 15:49 ` Kirill Tkhai
2020-01-31 16:01 ` Michal Hocko [this message]
2020-01-31 16:08 ` [PATCH v3] " Kirill Tkhai
2020-01-31 16:18 ` Michal Hocko
2020-02-03 9:31 ` Kirill Tkhai
2020-01-31 16:20 ` David Hildenbrand
2020-01-31 17:22 ` Shakeel Butt
2020-01-31 22:37 ` Roman Gushchin
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=20200131160151.GB4520@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shakeelb@google.com \
--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;
as well as URLs for NNTP newsgroup(s).