Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6990032ybi; Mon, 8 Jul 2019 12:13:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5Qf1He/gBTY8kI+nFYUOPgSW+YXzfMMRGH5KpZy6uhAJdzrjotHzExZa93F7lS0FoTXPN X-Received: by 2002:a63:ea50:: with SMTP id l16mr2295610pgk.160.1562613210705; Mon, 08 Jul 2019 12:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562613210; cv=none; d=google.com; s=arc-20160816; b=D9mGx8+EkxNhAbP719IFczcFgkkFGCa7Hj76eeR0KUNLiiHNuZVdbg5eYW8PsI9FlF ZnYtCG3aldnh+Xb6XXwcsCa8gW3o1K5qIiLEgh+1qG4Eo1MONphKvLI6XFOFC2DQbG2c G+QqPfMCWe7ozDb2vLpv0sbesaEp+QwA1NiVQuCUQWysizsqnaEKBKj0iB6poaIphzBl skY8P/Tf9bPsgvxgKINfKT7h3PZke6LsaefrsPJvE6raDMnU8gyWmMtjgZixX6G9k8fN z8Wbf93BOEWbBWWTOXvyNJhNvnCpwWti8NTfEVHc9QiSBwKniUKt4S0oLxElw4Ci0ERS yn8Q== 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=rWtXa7hDTK6s5p/U5luVocYUklpFugx0O13RYb/CB1Y=; b=e/9fAv4PY65O5n13UQNdOtcLEioX08huulNemczMKXlZvYkkPzg8KajjrX0TNNZ4vO DvGOfsAaur3hCWjrujU0ZuBOLiFmfSEr+lnzCsmX1/nSrHFTcWauABJ4ySVw5p075uwy HJRvd88AiMVpehdjIicypRByQujxel7ouP07dye3ymC84V5+willbIfFR4bX0VPlvQJD LXaAY39K0vOikYpXBz+FIgTvRwZ58xDjnB/T/xtrxJfGSn8l7iEyoUItjB9m6wQ/74wA 2jc7JNf9szxoBW7GKqm2/xL4cukhcTg85z6pNGL4toA5DnC6Vfraqst72uYIBI3xPCQi HYiA== 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 t21si356785pjq.62.2019.07.08.12.13.15; Mon, 08 Jul 2019 12:13:30 -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 S1731607AbfGHOIC (ORCPT + 99 others); Mon, 8 Jul 2019 10:08:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:2264 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbfGHOIC (ORCPT ); Mon, 8 Jul 2019 10:08:02 -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 x68E7e36095033 for ; Mon, 8 Jul 2019 10:08:01 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tm5yj3kfj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 08 Jul 2019 10:07:59 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Jul 2019 15:07:56 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) 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 15:07:53 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x68E7q5348758888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jul 2019 14:07:53 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6BB2A4051; Mon, 8 Jul 2019 14:07:52 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B03F9A4053; Mon, 8 Jul 2019 14:07:51 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 8 Jul 2019 14:07:51 +0000 (GMT) Date: Mon, 8 Jul 2019 19:37:51 +0530 From: Srikar Dronamraju To: Peter Zijlstra Cc: Markus Elfring , kernel-janitors@vger.kernel.org, Ingo Molnar , LKML Subject: Re: [PATCH] sched/topology: One function call less in build_group_from_child_sched_domain() Reply-To: Srikar Dronamraju References: <20190706172223.GA12680@linux.vnet.ibm.com> <20190708102312.GF3402@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20190708102312.GF3402@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 19070814-0016-0000-0000-000002904D88 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070814-0017-0000-0000-000032EDFB8B Message-Id: <20190708140751.GA10675@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-08_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=731 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080176 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra [2019-07-08 12:23:12]: > On Sat, Jul 06, 2019 at 10:52:23PM +0530, Srikar Dronamraju wrote: > > * Markus Elfring [2019-07-06 16:05:17]: > > > > > From: Markus Elfring > > > Date: Sat, 6 Jul 2019 16:00:13 +0200 > > > > > > Avoid an extra function call by using a ternary operator instead of > > > a conditional statement. > > > > > > This issue was detected by using the Coccinelle software. > > > > > > Signed-off-by: Markus Elfring > > > --- > > > kernel/sched/topology.c | 6 +----- > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > > > index f751ce0b783e..6190eb52c30a 100644 > > > --- a/kernel/sched/topology.c > > > +++ b/kernel/sched/topology.c > > > @@ -886,11 +886,7 @@ build_group_from_child_sched_domain(struct sched_domain *sd, int cpu) > > > return NULL; > > > > > > sg_span = sched_group_span(sg); > > > - if (sd->child) > > > - cpumask_copy(sg_span, sched_domain_span(sd->child)); > > > - else > > > - cpumask_copy(sg_span, sched_domain_span(sd)); > > > - > > > + cpumask_copy(sg_span, sched_domain_span(sd->child ? sd->child : sd)); > > > > At runtime, Are we avoiding a function call? > > However I think we are avoiding a branch instead of a conditional, which may > > be beneficial. > > It all depends on what the compiler does; also this is super slow path > stuff and the patch makes code less readable (IMO). > Yes, it definitely makes code readable. I was only commenting on the changelog/subject which says avoids a function call which I think it doesn't. -- Thanks and Regards Srikar Dronamraju