Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp38224lqp; Thu, 4 Apr 2024 06:38:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXklU6YgGq8n2cYa1GwvD/T1gaFL+6xQStnthFLpL8yjlMyEUNbt0nuyME17jVX3DBHthi/WvGAL9zMfwRu1JC2LBMVFN078nTpSq97eg== X-Google-Smtp-Source: AGHT+IHIzijdPKP+ctWx3iU06RsDhgd1YCNGT5JXirRnU6CdXWjAE8JseCI7cK5ZoV5S3mJduwDe X-Received: by 2002:ad4:5fc5:0:b0:698:7243:4843 with SMTP id jq5-20020ad45fc5000000b0069872434843mr2053433qvb.56.1712237901237; Thu, 04 Apr 2024 06:38:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712237901; cv=pass; d=google.com; s=arc-20160816; b=cY+yUky7qwuiDNGv6k9el7oW6GgLYdeeuaS0nVyHGrX2Q+bUDaj7F1W12/XQVpZ0Zp QhnIfEI9xgxAaXBVHAti4hGnKdEQ/FdDm8lTlK4cMIdtAqEa//XCuuE9YkPfDaX6Phit zOGxtzzYdWW7lF8FV/B7JE8cZvqoE4BClr5PdiqzmM7XXimXtOH+UI+s7mPa8MIrQA0c jlIO1GApgKGX/66H4k6tGXmnOu1hEYEMkuOltUOF9Atp3xLMhlyL9XqFEINyHFJr+ZlC Tmqv7s4+IKPPfFfkIQjMwBUubLENYY2k+iFSKU+rN8zXm6TlAKylGAfe7TWs3ttVTx7P g+gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=1Fzkg+80qwsIB2/aePP7C5EGMlo1ZkOGTSDqU2SxSNI=; fh=fe7UjhT4q/ZjxNY9QghPxrmy0chWYbcYdkT/Yj+3eXg=; b=VAJuxehwZSjamYPIcTOgOcOyetjfE+a3HwyEzH6Q9d5v0wLjSw17iwEaITyrmmM7tV Zb2sw6w38X9kXvAPtNvMXmJx/Fa3chCp13uvA3RQvRoNph+zha2vEuA3Vom7LkxBKn52 /eJsA4D/auh6Q+bZMaN0wz8jXYc0l9chO2V7ah4Fn0k+x3vCfLl9HhmRbgaDkzJYt1c+ IQU9IDx76nWpXm3ZWHqQVORNzri//ZSxdxfAE82cf4FmmA5NjfCzfiZhhZ3ZbN7vN36W zHxb168t+BXJwIXzY2NiikgBJ7TiJoiR8tgE5rri4EWqTdvp1tkVUanpuSGSQ9gSPM9g h4fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-131515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j4-20020a0cfd44000000b006968dc4dd63si16099815qvs.280.2024.04.04.06.38.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 06:38:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-131515-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 029D41C2618E for ; Thu, 4 Apr 2024 13:38:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42EEE1292C1; Thu, 4 Apr 2024 13:37:41 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AD65128362; Thu, 4 Apr 2024 13:37:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712237860; cv=none; b=kBiOSWJlKv4UFBttlHMvuPyzvIIHXY75IgigWIG/sihzCQjD1SVQKlsXV6REc4BXHYDebYCljJqN9NURa543A+CBFQFP1IUor/KpgZElWKmL7G8wgVDnTMgMCTojmYif46YHJiNncwdb8qrCZGfUhw9Imu2YEsFOOpZW9H7ZYJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712237860; c=relaxed/simple; bh=Mq8V4G+8NbZSQZrJJKuG0zWVsG03i73wOl1e9e2mO3Y=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YQ8KKzGzpPNM7AHbP7r2alPD3jEcqwaPSSYHq2+nUkjzgJfsKaOLaubnXEXhH5p7c+NGC9VSfNJcdO4MtHCgYXbDgwlHrokb08aLtyyvnEOxp5aQMCGAJaagbQ5bqeW+izIx6r2RJUZbZ2QyV3RmE31VqjpbJ6V1fOVc718wwqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) > > > @@ -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)) > > > /* > > > >