From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94BCEC433F5 for ; Fri, 14 Jan 2022 00:29:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20D5C6B0072; Thu, 13 Jan 2022 19:29:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BDBE6B0073; Thu, 13 Jan 2022 19:29:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0361C6B0074; Thu, 13 Jan 2022 19:29:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E5C4C6B0072 for ; Thu, 13 Jan 2022 19:29:40 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A69579791C for ; Fri, 14 Jan 2022 00:29:40 +0000 (UTC) X-FDA: 79027009320.26.5C06258 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf18.hostedemail.com (Postfix) with ESMTP id 23CAD1C0007 for ; Fri, 14 Jan 2022 00:29:39 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id b13so29413609edn.0 for ; Thu, 13 Jan 2022 16:29:39 -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=8EJiE87iFvzZs2wfpp7MhZSruKW5x9ebf2/nsWfIQAY=; b=KzGxA/Mn5jnF3eZqy7OWsndDxgnJpSHZAE+/AsMtTVpwYdR+j5o7zqZybAwsY3FtfC Zdhb4E/EIDEzf3/C/I6WWnCyQ3MVlat+azg4xSdQJ5PMhoLivaX+W0w2Ks8GBbKdjJKO 8cDYIaYTatdFa5sunv/AGeKgu/Bw4ABOVqHsc70RH7d0C5oA8w1qz2cMAQuH5ITEcfdf euxQZ8B3cT42PKxNQL0n8RDQyw5ILnnDrH6mR0+p5FeilycRyArnNQtA1lHzQMCBWEvq uSGjp71IEJm70ZrPWH56e7JGMeqBHO6cUeH1QRx0COuJBM1M3RxbXAH+TvdBkY7sRDuk fQ5Q== 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=8EJiE87iFvzZs2wfpp7MhZSruKW5x9ebf2/nsWfIQAY=; b=2I1lMIdru1BTM6Q8jZ9+mqCpFz82gCpQAIWgg4llt5Nal2Gf+zNsoIQTMGViWNkrg6 qIX/sqr6wBnCTXDyWgHbI/Hq8aLLaoH/rFDUnfwPWCv8G1rICX4xwd3NNysTxwKpLjTN 8yhxwPZ9mXSyCttf5sMerkJfBGXNiTag8hVyhksYGWq4ByZUPU1lMYWkWRQBtA90FUUl znjmnppNb+Nlls3zM7GZ3JW61oPdT9ILuNvQd3kIAeHtyU+/EH16wcd+r9srvlKpKlhE cndlZiqMkgVw42cDeY8cxvJfvBTw11EXPCSXHHyotKvFZ16sERkae090F/M0NU5PRJtA luXQ== X-Gm-Message-State: AOAM530qPSujlair8sU1moiCoxZL4AGq9sTQCJxvSEphBM2rhi7AYFH6 R8EZEP+yTIN/GfWtx8fPMV8= X-Google-Smtp-Source: ABdhPJwgzBvEezAa5NINhfz1SA5iwrNunoXYrzVrs5APytwkgDEFLy8R0bo2N6zJZtlQgqy2SIMUlw== X-Received: by 2002:a17:906:7e57:: with SMTP id z23mr5422663ejr.674.1642120178277; Thu, 13 Jan 2022 16:29:38 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id t8sm1710368edr.90.2022.01.13.16.29.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jan 2022 16:29:37 -0800 (PST) Date: Fri, 14 Jan 2022 00:29:37 +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: <20220114002937.fnyq3yyk36j4nb3d@master> Reply-To: Wei Yang References: <20220111010302.8864-1-richard.weiyang@gmail.com> <20220112004634.dc5suwei4ymyxaxg@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) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="KzGxA/Mn"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-Stat-Signature: ffbdxt5nwnhjtm7u91kdg8qhkgqbx8j4 X-Rspamd-Queue-Id: 23CAD1C0007 X-Rspamd-Server: rspam12 X-HE-Tag: 1642120179-169605 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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? >- 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; > >-- >2.30.2 > > >-- >Michal Hocko >SUSE Labs -- Wei Yang Help you, Help me