lkml.org 
[lkml]   [2020]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm: Allocate shrinker_map on appropriate NUMA node
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

\
 
 \ /
  Last update: 2020-01-31 17:03    [W:0.042 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site