Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6341558ybi; Mon, 8 Jul 2019 01:25:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmKE68B1B4Trh+vLEPyZtz85Gi77NqrLEH2KZsBLHF2u3uprt3MHZaWQd46Q119h6ANmCk X-Received: by 2002:a63:52:: with SMTP id 79mr21681645pga.381.1562574344248; Mon, 08 Jul 2019 01:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562574344; cv=none; d=google.com; s=arc-20160816; b=wU9KEg7JEhBc4UpdGf+AJvDDdq2ac0cPXAQIayxmGXt/kmDZvVaRNGU79wqwX8HGJy ZH6zBPsqWXoLeFRPFsz3qMW7stDsOvjRMVFKudP4sehvjLJYpauKjL99aW9Gh/uhAZpL 2dBG665zrZevUKVWKAOanCAziAzgZy6vW+LcWvyQcgQN2u3TkYSUGVvzSTgjo5Pqxcxa dFrNoTTGjeJ8O14yg9Yg1LNo1g313XxC+Ja1ngnHLi35tEBdrxFaTN4gOipWkDfsl7ZB o1uLmomI1UPMeaHKcImY40EeLWVKXQ7wY3VQiVbqsu78d9/C3eWIkmdQ5z+La3m62Zwz XRKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=FrewHBmHHbosbwlA9ZAnbuWpnlZIbuvtWRIK0tL2DXo=; b=J137Qq3ld7SLezU3ikCD4nXPeOGpUEV7jhEGTukTsVzR9N/+lXlinKacl07+KFzcKs OWfS0xpZOfFD0Op+LiiKl2o9IJEi6r5WOE9VANI16cqZiHYHdBAP9094Csq7NRFq0Dpx 2+uS4V1ucPnVYKvVaq+hWBc6CS4tqvTy5OMpBEND+5hdSLEu0St8LjJ2lbZdb0YLZRjw fBW1PE8NnyS97XxGG7ZwqayHNggoylMvYG/aACJvWMGKaKbb02LLCjwoSDWSLK6xbBkB wB7XYuAukixe+yo0teLgbYVg4fHMj2byhRNlHmvu2zO+KHbWqnz8AnXdnXFv8NBoC4fH Qcmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si17580646pgg.348.2019.07.08.01.25.28; Mon, 08 Jul 2019 01:25:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728264AbfGHEyo (ORCPT + 99 others); Mon, 8 Jul 2019 00:54:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:10066 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728195AbfGHEyn (ORCPT ); Mon, 8 Jul 2019 00:54:43 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x684plO0045828 for ; Mon, 8 Jul 2019 00:54:41 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tkwqjt95p-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 08 Jul 2019 00:54:41 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Jul 2019 05:54:39 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 8 Jul 2019 05:54:36 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x684sZaN44171408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jul 2019 04:54:35 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E84B4C044; Mon, 8 Jul 2019 04:54:35 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53FFF4C040; Mon, 8 Jul 2019 04:54:34 +0000 (GMT) Received: from localhost.in.ibm.com (unknown [9.124.35.94]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 8 Jul 2019 04:54:34 +0000 (GMT) From: Parth Shah To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, subhra.mazumdar@oracle.com Subject: [RFC 1/2] sched/fair: Rename select_idle_mask to iterator_mask Date: Mon, 8 Jul 2019 10:24:31 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708045432.18774-1-parth@linux.ibm.com> References: <20190708045432.18774-1-parth@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19070804-4275-0000-0000-0000034A0F3B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070804-4276-0000-0000-0000385A34E7 Message-Id: <20190708045432.18774-2-parth@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-08_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080062 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Per cpu variable 'select_idle_mask' serves the only purpose of an iterator inside select_idle_core method. Also there is an opportunity to optimize the search for an idle CPU for which this mask is required in the subsequent patch. Hence renaming this per_cpu variable to iterator mask which can be used locally for CPU iteration. Subsequent patch uses the select_idle_mask to keep track of the idle CPUs which can be shared across function calls. Signed-off-by: Parth Shah --- kernel/sched/core.c | 4 ++-- kernel/sched/fair.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4778c48a7fda..d5a6bdc956c8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5950,7 +5950,7 @@ static struct kmem_cache *task_group_cache __read_mostly; #endif DECLARE_PER_CPU(cpumask_var_t, load_balance_mask); -DECLARE_PER_CPU(cpumask_var_t, select_idle_mask); +DECLARE_PER_CPU(cpumask_var_t, iterator_mask); void __init sched_init(void) { @@ -5989,7 +5989,7 @@ void __init sched_init(void) for_each_possible_cpu(i) { per_cpu(load_balance_mask, i) = (cpumask_var_t)kzalloc_node( cpumask_size(), GFP_KERNEL, cpu_to_node(i)); - per_cpu(select_idle_mask, i) = (cpumask_var_t)kzalloc_node( + per_cpu(iterator_mask, i) = (cpumask_var_t)kzalloc_node( cpumask_size(), GFP_KERNEL, cpu_to_node(i)); } #endif /* CONFIG_CPUMASK_OFFSTACK */ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fdab7eb6f351..20affe03379d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5294,7 +5294,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) /* Working cpumask for: load_balance, load_balance_newidle. */ DEFINE_PER_CPU(cpumask_var_t, load_balance_mask); -DEFINE_PER_CPU(cpumask_var_t, select_idle_mask); +DEFINE_PER_CPU(cpumask_var_t, iterator_mask); #ifdef CONFIG_NO_HZ_COMMON /* @@ -6083,7 +6083,7 @@ void __update_idle_core(struct rq *rq) */ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int target) { - struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask); + struct cpumask *cpus = this_cpu_cpumask_var_ptr(iterator_mask); int core, cpu; if (!static_branch_likely(&sched_smt_present)) -- 2.17.1