Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2053418pxb; Sun, 16 Jan 2022 08:23:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8NErabgx2VFPi/qx+6j3rEns6DNbWNl9LGZg5F6twOpbMJ649d6/Eb3f9fECL2/ng4lqX X-Received: by 2002:a17:902:b20f:b0:149:9483:9407 with SMTP id t15-20020a170902b20f00b0014994839407mr18847932plr.54.1642350205555; Sun, 16 Jan 2022 08:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642350205; cv=none; d=google.com; s=arc-20160816; b=mXUuITlQkTbdMgfNGt2MdP9D+JWXKIqvE2yoJF+ojO8DwwZXkOXe74XYOBhUN+sF4B iARiyw7ruCKcrUGkGvkyvO5KwNSG4HcxHLeLNcHOWWrqcX21Q64cgvu6bJlekwLZDtHh 2TB/0qqM3H+7I7v9vFgJrKMZsJs9ZKBojNRfSHspr1tPBhtPKeBkoVKPDq0JLmbLRxyF 8WdnDlJKAheHCKrl4aN5qNjYtzDK8O7dvmEAArD+djFNw53Ddst63QfG8kG7rfm0eRQD 9Fs5mXqQaTAGcE9y4UfiByuWIjQgvFVim0ksLX/PlnYThNXmxJMstS75L8BtsE1vbiju PuKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EPbI8Tt0WfUMwAmaR0DL4u0NGyT4Pfp5ibYD0UcG0DI=; b=hLOdUw6/oNJb9YkuL9NQUw+HUDj6ffgl/p/2f4z5paRaPRs1t9R2a/4tDJRSQwmpyE A9oCNCawL8kmLFJFwVOfY7zBNnmddNtp2myBIastzXigv5F5FTL0xuGLHJBEBcXmj26f sMjdyKankrpZRsoV9RZT3XZdcDB/lkNuhdmG5xDF1JDyeUn+1v94gDc119+xI1fsDN86 dMqKbexRpb/Ae6LKSYj5k0Jsi0d9vJPfs8N0CLIl1FvSXgUTs0leLqZtBBZS99tUigiT sLZICDj/hlzOnNo5g9P/iayfz+uIKIWNDi+IFWxQf/EpAtfzoJwFMAdP8cpn1Bdf8pLI 53Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=agj6fChY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s133si11568127pgs.776.2022.01.16.08.23.13; Sun, 16 Jan 2022 08:23:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=agj6fChY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233815AbiAOWK1 (ORCPT + 99 others); Sat, 15 Jan 2022 17:10:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiAOWK0 (ORCPT ); Sat, 15 Jan 2022 17:10:26 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80FA4C061574; Sat, 15 Jan 2022 14:10:26 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id m4so48261222edb.10; Sat, 15 Jan 2022 14:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EPbI8Tt0WfUMwAmaR0DL4u0NGyT4Pfp5ibYD0UcG0DI=; b=agj6fChYEnKrSoNxBVq48eG35QoBd5Z4IF+iAiicRpU2JWeJ9LfMJNox6L4q2g2RBL 4ETDJyBfAyhwTeit7qORH7ag0LnhF2LlADK4vfaVOzEQi/ZW5lHvfa82MDys4hXQK+C3 4hJN/NnQMc73yqTl5qISSYt5yrcUMzgCFAXwTi3GLM1kOeIw6js15Tx/R0XIYwz6PTXa 4ZwyvjW7pSAjcoWl9BMhmTQ0SloTVQLPkExYXobQE08n1ZfTuuww4aVBjSKCVRKtf75l UwhvkbPdJkfEIcvOk0IyuUjkHa+J6Ffexa9DabrExe6AtDsr+WdXHHvkyFsvbMoVt92K o4yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EPbI8Tt0WfUMwAmaR0DL4u0NGyT4Pfp5ibYD0UcG0DI=; b=DS8iPNcuvqk+asW/cA38H82w0E+EjGgqt1gbAU9JFKjfjuj+OuKuNIpRvc1vSTLdvt DTUYU1SWA4e08/D8ImK0zTUcZT6tZL9PWl0jNxEeOlfTgFyuspVv7/pTyZmWhTZjt53j BPtXQfwGAlWHLk9Lgx8u66aq3vAt1DNiF15OX+VSx60Y/DvXqP/uoKzehiqbBBsi5PLi WnI+Yf6dADUFWXcp7v9y1mmj6YFFrVb+dllUh/akGBldsrJjMy6/3Hy4m3euyWNPUubI zFxZpYMs3JQQDYCFyKovGrS3Oc1g+O4w/RnlLFZTDlaIZWZFIAUE3Q8JWlniP6hbs5R3 WuHA== X-Gm-Message-State: AOAM53217UHEIH0H3Q+lJ7IME0FhtGWIll2UVjhqaV2mLepYmPRifzBs hFP0ApneTSFxl+/3vwAv4lY= X-Received: by 2002:a17:907:9085:: with SMTP id ge5mr12006871ejb.128.1642284624835; Sat, 15 Jan 2022 14:10:24 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id j5sm2957736ejo.177.2022.01.15.14.10.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Jan 2022 14:10:24 -0800 (PST) Date: Sat, 15 Jan 2022 22:10:23 +0000 From: Wei Yang To: Michal Hocko Cc: Wei Yang , hannes@cmpxchg.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, shakeelb@google.com, guro@fb.com, vbabka@suse.cz, willy@infradead.org, songmuchun@bytedance.com, shy828301@gmail.com, surenb@google.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/4] mm/memcg: use NUMA_NO_NODE to indicate allocation from unspecified node Message-ID: <20220115221023.qndjlehjxdrj5r6b@master> Reply-To: Wei Yang References: <20220111010302.8864-1-richard.weiyang@gmail.com> <20220112004634.dc5suwei4ymyxaxg@master> <20220114002937.fnyq3yyk36j4nb3d@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >> >> > >> >> >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@kernel.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 >> >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 >> >Signed-off-by: Michal Hocko >> >--- >> > 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