Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp438872ybl; Thu, 12 Dec 2019 21:50:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzc/7aGgpxodImhqj9fLSFsGyoT4Q+XdoqFM+itmfAcLH6nhbLchGmqRV1A/fzvWkQyNPU+ X-Received: by 2002:a9d:1b4e:: with SMTP id l72mr13040632otl.345.1576216239905; Thu, 12 Dec 2019 21:50:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576216239; cv=none; d=google.com; s=arc-20160816; b=kn0r048HSxbE1A8CyCJOsq7jrtfcmGNWRGHCYHWQ3t27DGN5NI3zTCLT9xbRXl2WaI QnyTTYyZ6UfZek7Mc+TQ/D9Ov2TSQbLzO5nS8lXcSQCm5y+Q8BrqDr3rHrTrAxruugN2 OEBCKTfPLfbNnELr2Uytx7ews0UZbSHE56I4ImDAigB+TRaLgH2iOuEN77OmzDyGEoBj 38vlfKPG/2KLMkC+Ceso7soxyxR/7AuW6HK35hrffwx2fds+x+qY2OaRJLQbYQsxYLac S08lAGmagm3HHN5BOYwV/jHgCzB7qV5AjXVV1JMDYxZtxMm0Q6+BeG5WiRv9g/1TirhM ee/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=RvLV3fwzMmhWN3HDIVkT7OIeAh+A0yyfdntR6MuDo4g=; b=RILRjjCymhdB1+2NFmuPkmhg9RkzhQujO4thO5eqDmU2mF+a8Sx72gw1eOhgf2VW2n HRYoLMJy5ikcVnVOB6/3nV677oxbgNV/CKzzsLpQR/nQRYBXzYR/gD7X9fttMjigC0k7 pE3vS+iUMak/yPtPr32xYWyH1Hc4/p/uIi7laV1OLkpFnyVuEiANnrlzPg8OL3FJY8t1 Yvm8pylyy/dj1TUXYr5NfKBJCjAI1K/p7D+zudk8RQS71IFId5p6YEwQDX6h13fBmnCf mpdwjX7+QqbFdNy2cF4JzqSelxm9xACqAIO7vqepHm2X4rWJNw18+ADF2lRWKus3y1fa Qtjw== 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 o13si4694673otp.27.2019.12.12.21.50.26; Thu, 12 Dec 2019 21:50:39 -0800 (PST) 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 S1727474AbfLMFNk (ORCPT + 99 others); Fri, 13 Dec 2019 00:13:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:16336 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725385AbfLMFNk (ORCPT ); Fri, 13 Dec 2019 00:13:40 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBD5CPOs134972 for ; Fri, 13 Dec 2019 00:13:38 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wuswrr59q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 13 Dec 2019 00:13:38 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Dec 2019 05:13:36 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 13 Dec 2019 05:13:33 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBD5DWFl52559926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Dec 2019 05:13:32 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4EBDAAE057; Fri, 13 Dec 2019 05:13:32 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66F6EAE051; Fri, 13 Dec 2019 05:13:30 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av26.portsmouth.uk.ibm.com (Postfix) with SMTP; Fri, 13 Dec 2019 05:13:30 +0000 (GMT) Date: Fri, 13 Dec 2019 10:43:29 +0530 From: Srikar Dronamraju To: Cheng Jian Cc: mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, chenwandun@huawei.com, xiexiuqi@huawei.com, liwei391@huawei.com, huawei.libin@huawei.com, bobo.shaobowang@huawei.com, juri.lelli@redhat.com, vincent.guittot@linaro.org Subject: Re: [PATCH v2] sched/fair: Optimize select_idle_cpu Reply-To: Srikar Dronamraju References: <20191213024530.28052-1-cj.chengjian@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20191213024530.28052-1-cj.chengjian@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 19121305-0012-0000-0000-00000374545D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19121305-0013-0000-0000-000021B032A7 Message-Id: <20191213051329.GB23839@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-12_08:2019-12-12,2019-12-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 adultscore=0 impostorscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912130043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Cheng Jian [2019-12-13 10:45:30]: > Fixes: 1ad3aaf3fcd2 ("sched/core: Implement new approach to scale select_idle_cpu()") > Signed-off-by: Cheng Jian > --- > kernel/sched/fair.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 08a233e97a01..d48244388ce9 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -5828,6 +5828,7 @@ static inline int select_idle_smt(struct task_struct *p, int target) > */ > static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int target) > { > + struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask); > struct sched_domain *this_sd; > u64 avg_cost, avg_idle; > u64 time, cost; > @@ -5859,11 +5860,11 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > > time = cpu_clock(this); > > - for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { > + cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > + > + for_each_cpu_wrap(cpu, cpus, target) { > if (!--nr) > return si_cpu; > - if (!cpumask_test_cpu(cpu, p->cpus_ptr)) > - continue; > if (available_idle_cpu(cpu)) > break; > if (si_cpu == -1 && sched_idle_cpu(cpu)) Looks good to me. Reviewed-by: Srikar Dronamraju -- Thanks and Regards Srikar Dronamraju