[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d272ca7-2bc7-c566-bde8-34e7b6510fb4@redhat.com>
Date: Fri, 31 Jan 2020 17:20:30 +0100
From: David Hildenbrand <david@...hat.com>
To: Kirill Tkhai <ktkhai@...tuozzo.com>,
Michal Hocko <mhocko@...nel.org>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, shakeelb@...gle.com,
vdavydov.dev@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] mm: Allocate shrinker_map on appropriate NUMA node
On 31.01.20 17:08, Kirill Tkhai wrote:
> mm: Allocate shrinker_map on appropriate NUMA node
>
> From: Kirill Tkhai <ktkhai@...tuozzo.com>
>
> Despite shrinker_map may be touched from any cpu
> (e.g., a bit there may be set by a task running
> everywhere); kswapd is always bound to specific
> node. So, we will allocate shrinker_map from
> related NUMA node to respect its NUMA locality.
> Also, this follows generic way we use for allocation
> memcg's per-node data.
You can go up to 72 characters in your patch description :)
Reviewed-by: David Hildenbrand <david@...hat.com>
>
> Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
>
> v3: Remove node_state() patterns.
> v2: Use NUMA_NO_NODE instead of -1.
> ---
> mm/memcontrol.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 6f6dc8712e39..c37382f5a43c 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -334,7 +334,7 @@ static int memcg_expand_one_shrinker_map(struct mem_cgroup *memcg,
> if (!old)
> return 0;
>
> - new = kvmalloc(sizeof(*new) + size, GFP_KERNEL);
> + new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
> if (!new)
> return -ENOMEM;
>
> @@ -378,7 +378,7 @@ static int memcg_alloc_shrinker_maps(struct mem_cgroup *memcg)
> mutex_lock(&memcg_shrinker_map_mutex);
> size = memcg_shrinker_map_size;
> for_each_node(nid) {
> - map = kvzalloc(sizeof(*map) + size, GFP_KERNEL);
> + map = kvzalloc_node(sizeof(*map) + size, GFP_KERNEL, nid);
> if (!map) {
> memcg_free_shrinker_maps(memcg);
> ret = -ENOMEM;
>
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists