[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YfkFH2H8Gzs7jXZp@dhcp22.suse.cz>
Date: Tue, 1 Feb 2022 11:02:07 +0100
From: Michal Hocko <mhocko@...e.com>
To: linux-kernel@...r.kernel.org
Cc: mm-commits@...r.kernel.org, tj@...nel.org, rppt@...ux.ibm.com,
raquini@...hat.com, osalvador@...e.de, npache@...hat.com,
eric.dumazet@...il.com, dennis@...nel.org, david@...hat.com,
cl@...ux.com, amakhalov@...are.com, richard.weiyang@...il.com,
akpm@...ux-foundation.org
Subject: Re: +
memcg-do-not-tweak-node-in-alloc_mem_cgroup_per_node_info.patch added to -mm
tree
On Mon 31-01-22 14:19:01, Andrew Morton wrote:
> From: Wei Yang <richard.weiyang@...il.com>
> Subject: 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
Wei has pointed to my typo here. s@not !node_online@...line@
> appropriate data structure allocated. This has changed by "mm: handle
> uninitialized numa nodes gracefully" so we can drop the special casing
> here.
>
> Link: https://lkml.kernel.org/r/20220127085305.20890-7-mhocko@kernel.org
> Signed-off-by: Wei Yang <richard.weiyang@...il.com>
> Signed-off-by: Michal Hocko <mhocko@...e.com>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Alexey Makhalov <amakhalov@...are.com>
> Cc: Dennis Zhou <dennis@...nel.org>
> Cc: Eric Dumazet <eric.dumazet@...il.com>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: Nico Pache <npache@...hat.com>
> Cc: Wei Yang <richard.weiyang@...il.com>
> Cc: Mike Rapoport <rppt@...ux.ibm.com>
> Cc: Oscar Salvador <osalvador@...e.de>
> Cc: Rafael Aquini <raquini@...hat.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
>
> mm/memcontrol.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
> --- a/mm/memcontrol.c~memcg-do-not-tweak-node-in-alloc_mem_cgroup_per_node_info
> +++ a/mm/memcontrol.c
> @@ -5067,18 +5067,8 @@ struct mem_cgroup *mem_cgroup_from_id(un
> 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.
> - */
> - if (!node_state(node, N_NORMAL_MEMORY))
> - tmp = -1;
> - pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, tmp);
> +
> + pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, node);
> if (!pn)
> return 1;
>
> _
>
> Patches currently in -mm which might be from richard.weiyang@...il.com are
>
> mm-page_alloc-add-same-penalty-is-enough-to-get-round-robin-order.patch
> mm-page_alloc-add-penalty-to-local_node.patch
> memcg-do-not-tweak-node-in-alloc_mem_cgroup_per_node_info.patch
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists