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 DF474CD1284 for ; Thu, 4 Apr 2024 13:37:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A6456B0082; Thu, 4 Apr 2024 09:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7565A6B0089; Thu, 4 Apr 2024 09:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 645356B008A; Thu, 4 Apr 2024 09:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 49CDF6B0082 for ; Thu, 4 Apr 2024 09:37:42 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F18591A0D7A for ; Thu, 4 Apr 2024 13:37:41 +0000 (UTC) X-FDA: 81971951922.04.BA0D042 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf05.hostedemail.com (Postfix) with ESMTP id 6750F10001E for ; Thu, 4 Apr 2024 13:37:39 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712237859; a=rsa-sha256; cv=none; b=ewkP/N9LqEkXpXoa7ME4ioJkIb4aK3uDV/Qp/qWI3QOxnTh+nGJgs/69Zmd7MJIDRO01T1 hXmY9q5yj6il+slGRKJgW3CZcMfXS0/tpCr8oZPNnPk0sw5aRXQNXctpUw8TKuk93qZldy Fb2LOW4tiQN0BIE1VyWPyQiOwpfUrjE= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712237859; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Fzkg+80qwsIB2/aePP7C5EGMlo1ZkOGTSDqU2SxSNI=; b=ZAMqwOQoxTGTohxbNMk5DLbmM+HmdfMYK7YeZ0RR2wAD5Ag+AlV0N8jlWRRbvXix+FrBoP DlxjB2DonJy3aN7HvQN4i4EoUBdNu2HoML2LzV8UzzITntTK58VS5ql3289BmbAXiucSGq Z1LGO5wXmQumd99VQ/RrCPgx5a74/+o= Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4V9Mxg3Zsyz6J7DR; Thu, 4 Apr 2024 21:32:55 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AFE8F1400DC; Thu, 4 Apr 2024 21:37:34 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 4 Apr 2024 14:37:33 +0100 Date: Thu, 4 Apr 2024 14:37:33 +0100 From: Jonathan Cameron To: "Ho-Ren (Jack) Chuang" CC: "Huang, Ying" , Gregory Price , , , , , Eishan Mirakhur , Vinicius Tavares Petrucci , Ravis OpenSrc , Alistair Popple , Srinivasulu Thanneeru , SeongJae Park , Dan Williams , Vishal Verma , Dave Jiang , "Andrew Morton" , , , , "Linux Memory Management List" , "Ho-Ren (Jack) Chuang" , "Ho-Ren (Jack) Chuang" , , Hao Xiang Subject: Re: [PATCH v10 2/2] memory tier: create CPUless memory tiers after obtaining HMAT info Message-ID: <20240404143733.00004594@Huawei.com> In-Reply-To: References: <20240402001739.2521623-1-horenchuang@bytedance.com> <20240402001739.2521623-3-horenchuang@bytedance.com> <20240403180425.00003be0@Huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6750F10001E X-Stat-Signature: ijut6js5sh1d5pu1789zc65a3xj961u1 X-HE-Tag: 1712237859-91034 X-HE-Meta: U2FsdGVkX1+2sZak36Ef15ReZ86YSSabBug4wSC1J45NG28fVIyXwitaaSW0my0ieo8DpiskNX9a+vhkIVu0Lt6yfgZFjkI704THWH/HDBByMK2NJ4IgcIFzT46BOpOVSsbv6GeNhdhpYGGAp4Ol4h48kYw53/TB31y+rqabp8PKfvIpRXgTeSGZLM/A5epeATx5y4Pvia3ewWGSlKeh2sNGFwS5A0v5b+aFoGBdSY6VizogzLgU/9gVrVFSoJyOGx1BD50n3aTKe8jeK+tnR7WlcmiJjdAVRzNPXyjvc0UkVHcxlzvq5aVn07xZ3vDgOj59cL7BQrWuIwxyofVpV+CObzjfRDPWyBr/NsRXTzJUlzg/4FxdmSrIexgSRTvxHpu3FmaIqxjprTYUJZaBzz6owGCM4MJJM69YaUu+feS9HmzjYluXFOJWFRXtMMz2Yj7u3aKxmJ/jmVyJeCTCp2OMxP3uSWc/46rorDnw1k3Rg3Kd8NnS/npPgwD1fGqYFNp0SVH/XbbeDErGW8tgXQXRuPvqeeqiAxWqoWGCFyW087j8Ps6nGkXGtxKiPQc9EZ7PS2veOR6wznvozVlUoH/VtXlpy7aP5F0wHlMSm3xMmgYTo7JJ0SnHPMi+jhxKoUWS4HFZh59t26ENKCXVKtkw0lkPS/8lZ7u1h5yPronlsJOTaSKxqh9rKypzar9yTJXVOhxysPLFc3b4EuEj2/c2+/9LHyXMwiwTll6a/Ru2JwM/LxU2jF4PD0OyraxURzL9fQF+oDAZVIG+KWVO92sFROucXOSLmmKTjf5M3sHIyywCFD+UTj+HNYcWKbDBjxgZ8djTuhhd5Cv6w9Lk3uPQKOzAlpBp3v6JY+dCRiTjzYVEPioJJJAMO9OeCNrTEmS9XYnPLFNzEUP5qD4BKFQMoxEOpvx0CXq9HBTkTWgQt7N2H2kcXHLIWZQQnlzxIScdwrmEZVI= 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: List-Subscribe: List-Unsubscribe: > > > @@ -858,7 +910,8 @@ static int __init memory_tier_init(void) > > > * For now we can have 4 faster memory tiers with smaller adistance > > > * than default DRAM tier. > > > */ > > > - default_dram_type = alloc_memory_type(MEMTIER_ADISTANCE_DRAM); > > > + default_dram_type = mt_find_alloc_memory_type(MEMTIER_ADISTANCE_DRAM, > > > + &default_memory_types); > > > > Unusual indenting. Align with just after ( > > > > Aligning with "(" will exceed 100 columns. Would that be acceptable? I think we are talking cross purposes. default_dram_type = mt_find_alloc_memory_type(MEMTIER_ADISTANCE_DRAM, &default_memory_types); Is what I was suggesting. > > > > if (IS_ERR(default_dram_type)) > > > panic("%s() failed to allocate default DRAM tier\n", __func__); > > > > > > @@ -868,6 +921,14 @@ static int __init memory_tier_init(void) > > > * types assigned. > > > */ > > > for_each_node_state(node, N_MEMORY) { > > > + if (!node_state(node, N_CPU)) > > > + /* > > > + * Defer memory tier initialization on CPUless numa nodes. > > > + * These will be initialized after firmware and devices are > > > > I think this wraps at just over 80 chars. Seems silly to wrap so tightly and not > > quite fit under 80. (this is about 83 chars. > > > > I can fix this. > I have a question. From my patch, this is <80 chars. However, > in an email, this is >80 chars. Does that mean we need to > count the number of chars in an email, not in a patch? Or if I > missed something? like vim configuration or? 3 tabs + 1 space + the text from * (58) = 24 + 1 + 58 = 83 Advantage of using claws email for kernel stuff is it has a nice per character ruler at the top of the window. I wonder if you have a different tab indent size? The kernel uses 8 characters. It might explain the few other odd indents if perhaps you have it at 4 in your editor? https://www.kernel.org/doc/html/v4.10/process/coding-style.html Jonathan > > > > + * initialized. > > > + */ > > > + continue; > > > + > > > memtier = set_node_memory_tier(node); > > > if (IS_ERR(memtier)) > > > /* > > > >