Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2061922iof; Tue, 7 Jun 2022 18:29:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7i131jZSx7Ap87qGPxFfRGZ/ahf2SQxOSvn2M8fMtmTGLfIgYCIno+xhQyPVKCtqv1SuG X-Received: by 2002:a17:90b:180e:b0:1e8:3023:eeb9 with SMTP id lw14-20020a17090b180e00b001e83023eeb9mr27416093pjb.55.1654651741724; Tue, 07 Jun 2022 18:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654651741; cv=none; d=google.com; s=arc-20160816; b=kZbRLvf1osFyeHH6iCDYrXX0jxNEi019RAserHpEKinpP9GnRoY/fKhYJdLM32pS/X zP7ewST0Jetq//Y0+XVWGXCDwlX/eefpskH34myeizml2B4ARUvYUn0+XwYu7ZMPWoXc bV/BepsKfvt13Pm+8rS8RKdP5w8iL7sAo35EpjRloDObYT5xRQM900O8dirCLCn/+jfZ Vi58dk+dvA5sNyb1uS6/t2PDBfJpMEabfDQ0NyRtS0PcC1jHin7Wu5N5X+wyU1NV/+E9 6OjGrDOcyJwH8R6BS4RIlsTzVTrKenwFglimXuRsEOIs3LWbtRSwbRpBX9K4djDl5sTp Ij4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Dq87uuWvqNcft2PppS68NEx0KkjLdakISmc58o0YGBM=; b=JcrHWnsJvJRze7WuW7SsefZo1uwmxCRBWyd0DAqx2T+8SphAbEz/CchU4uiMB9c789 FSzFzBAe84qFYczRGRHTw5GqpLFZKWCaFLPwZy+7Byfm9aizLsk0PmRQAbZWMfKtpXSf gSa2Mjrd/UJGDuea0hdbq0BQed9ExXCBIese9wKPWcJ/Z/hyGGYBSkuPXzs+cx5yf4Xm NvcMybfm1CZb5g+jzXrPy2C0z3qqAq+vnLI2gRjm0sfQlhQ2sgM2vv6fhOC8vj8XFjdT 8V+t45WOmljzk4JgJhoNEmPyXrMdGODVOrPlJAMPa5ovpac6AyKtvdwxHep/3+d1kZLV J3nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g10-20020a636b0a000000b003fda3857360si11499501pgc.743.2022.06.07.18.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 18:29:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D9AD24A6AD; Tue, 7 Jun 2022 18:20:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238155AbiFGI1w (ORCPT + 99 others); Tue, 7 Jun 2022 04:27:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231952AbiFGI1s (ORCPT ); Tue, 7 Jun 2022 04:27:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00B842C673 for ; Tue, 7 Jun 2022 01:27:46 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 839CB143D; Tue, 7 Jun 2022 01:27:46 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7D36A3F73B; Tue, 7 Jun 2022 01:27:44 -0700 (PDT) Message-ID: Date: Tue, 7 Jun 2022 10:27:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3] sched/fair: static cpumasks for load balance Content-Language: en-US To: Bing Huang , peterz@infradead.org Cc: brauner@kernel.org, bristot@redhat.com, bsegall@google.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com, rostedt@goodmis.org, vincent.guittot@linaro.org References: <20220602030135.398697-1-huangbing@kylinos.cn> From: Dietmar Eggemann In-Reply-To: <20220602030135.398697-1-huangbing@kylinos.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/2022 05:01, Bing Huang wrote: > The both cpu mask load_balance_mask and select_idle_mask just only used > in fair.c, but allocation in core.c in CONFIG_CPUMASK_OFFSTACK=y case, > and global via declare per cpu variations. More or less, it looks wired. Maybe you can change this into: sched/fair: Make per-cpu cpumasks static load_balance_mask and select_idle_mask are only used in fair.c. Make them static and move their allocation into init_sched_fair_class(). Replace kzalloc_node() with zalloc_cpumask_var_node() to get rid of the CONFIG_CPUMASK_OFFSTACK #ifdef and to align with per-cpu cpumask allocation for RT (local_cpu_mask in init_sched_rt_class()) and DL class (local_cpu_mask_dl in init_sched_dl_class()). > Co-developed-by: Dietmar Eggemann You can remove the `Co-developed-by`. I was just reviewing the patch and gave suggestions. [...] > @@ -11841,6 +11841,15 @@ void show_numa_stats(struct task_struct *p, struct seq_file *m) > __init void init_sched_fair_class(void) > { > #ifdef CONFIG_SMP > + int i; > + > + for_each_possible_cpu(i) { > + zalloc_cpumask_var_node(&per_cpu(load_balance_mask, i), > + GFP_KERNEL, cpu_to_node(i)); > + zalloc_cpumask_var_node(&per_cpu(select_idle_mask, i), > + GFP_KERNEL, cpu_to_node(i)); @@ -11815,9 +11815,9 @@ __init void init_sched_fair_class(void) for_each_possible_cpu(i) { zalloc_cpumask_var_node(&per_cpu(load_balance_mask, i), - GFP_KERNEL, cpu_to_node(i)); + GFP_KERNEL, cpu_to_node(i)); zalloc_cpumask_var_node(&per_cpu(select_idle_mask, i), - GFP_KERNEL, cpu_to_node(i)); + GFP_KERNEL, cpu_to_node(i)); } [...] Reviewed-by: Dietmar Eggemann