Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5881425imm; Tue, 12 Jun 2018 15:12:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwwsWjaWrP3POKhmdlQlhRIxTlldJUfR27oid6Kk1SMsJnGtVlTStf35tiQiCUX1ypU8qT X-Received: by 2002:a62:da07:: with SMTP id c7-v6mr2200623pfh.106.1528841578048; Tue, 12 Jun 2018 15:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528841577; cv=none; d=google.com; s=arc-20160816; b=q/8GgCr8eoMD7D6syREpfvXd1Y93R1Dlx+3q19YTm1jrX7Doe7daGuqUbZTRleOujv ZeG14pEHuxF/8UjJ2rgrLOnui7a090WFF0aVD3TxkO8It7vmi0yE/0zKBFqMD9yA0wij ALi/tdXtUmOM2mP8OUjDjDndsko79v0GikC44VUMpMy3rg5DelOgsksxKmY6BujasYR6 9PhGEiwA+Yn4iOjqd+dsdk0n8av+lpXV7vgDSsLIN7954sHbcVlcLLllDgTL3b/Ni3gR ksPGMPNL9c8WQ3TciCXLlUr0N/nBLHLN5zDPem0XayVyfOhsBZzEHHqqOW1AkxgRbfFz yagw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=FlN9Swwmped8814KFwYcSbWvoiTF6BYWLpj1qeGHzR0=; b=DFheWemwH9pfKHk+184feDYUiRcRbBqvmNKEmjGEOKZd8jQ1M8LprkrE3TmbxPK3Jg up732xvyubvShkK4iNgM3xgvFXbQEfDgk/WeFQKVzWCP0RhTXj83/XjEgXPRtP2IkMCL bAFJ7FJpZtqTTThcfnsepbZ3imOA21HH1q+CE0ATbicTgaNKzPECCFWkNiSnBlz7cX7b twWNfL5HBSHmV1dgBu8i/Ir2c0BuUwljsa2eZB1aCzaEsO0xSsinhphSqRZ61xvG3v7v olYwUNPKeBmhn9ZMm54nGHrgT9NIsk6y30S8dVS1+G/8CIzlnr2x/QNtcupgOy9yxU5E JPHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=hMeSsZ5K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c83-v6si1063620pfl.319.2018.06.12.15.12.43; Tue, 12 Jun 2018 15:12:57 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=hMeSsZ5K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934525AbeFLWLX (ORCPT + 99 others); Tue, 12 Jun 2018 18:11:23 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33850 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934282AbeFLWLW (ORCPT ); Tue, 12 Jun 2018 18:11:22 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5CMAqKp127452; Tue, 12 Jun 2018 22:10:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=FlN9Swwmped8814KFwYcSbWvoiTF6BYWLpj1qeGHzR0=; b=hMeSsZ5KUtC6xCnMwBVDtFA38+o7nkcIdfaaF3+PwPuYtjV0kLgnb0zi/FS3RM6Lywks yVrX+lfiX7MM5tuAft10HSm6h4gJEpMVDCpcikFpe6ZStU0nqb90SjSBeJdglmt1aNX5 8cfJzLsrLmxyrgSSVffbY5OSSKVL2ScNnRID+dG+41k0H7uLuCgb28yETqHGOnY48oRN Lbph62QncCYkOiI3k48mdH/0DGjaEfd7nT6ptIZc37U1qjvx5LsR+gsO7QzZqre4C3LI wzw/TRkyHKo1kX2XrliIyeJlDeHMjlMYa1Y/Uhe6GjB0peI9fMZl8yzADyxGqtlPO53P aA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2jjp6br2jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Jun 2018 22:10:51 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5CMAplA007590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Jun 2018 22:10:51 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5CMAoWj025595; Tue, 12 Jun 2018 22:10:51 GMT Received: from [10.132.91.87] (/10.132.91.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 12 Jun 2018 15:10:50 -0700 Subject: Re: [PATCH 1/5] sched: limit cpu search in select_idle_cpu To: kbuild test robot Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, steven.sistare@oracle.com, dhaval.giani@oracle.com, rohit.k.jain@oracle.com, daniel.lezcano@linaro.org References: <20180612175002.31453-2-subhra.mazumdar@oracle.com> <201806130240.AQdYDV0h%fengguang.wu@intel.com> From: Subhra Mazumdar Message-ID: Date: Tue, 12 Jun 2018 15:12:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806130240.AQdYDV0h%fengguang.wu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8922 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806120245 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/2018 01:33 PM, kbuild test robot wrote: > Hi subhra, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on tip/sched/core] > [also build test WARNING on v4.17 next-20180612] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/subhra-mazumdar/Improve-scheduler-scalability-for-fast-path/20180613-015158 > config: i386-randconfig-x070-201823 (attached as .config) > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 > > All warnings (new ones prefixed by >>): > > kernel/sched/fair.c: In function 'select_idle_cpu': >>> kernel/sched/fair.c:6396:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] > u64 span_avg = sd->span_weight * avg_idle; > ^~~ > > I fixed this patch, please try the following ---8<--- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e497c05..7243146 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6372,7 +6372,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t ??????? u64 avg_cost, avg_idle; ??????? u64 time, cost; ??????? s64 delta; -?????? int cpu, nr = INT_MAX; +?????? int cpu, limit, floor, nr = INT_MAX; ??????? this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); ??????? if (!this_sd) @@ -6390,10 +6390,17 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t ??????? if (sched_feat(SIS_PROP)) { ??????????????? u64 span_avg = sd->span_weight * avg_idle; -?????????????? if (span_avg > 4*avg_cost) +?????????????? floor = cpumask_weight(topology_sibling_cpumask(target)); +?????????????? if (floor < 2) +?????????????????????? floor = 2; +?????????????? limit = 2*floor; +?????????????? if (span_avg > floor*avg_cost) { ??????????????????????? nr = div_u64(span_avg, avg_cost); -?????????????? else -?????????????????????? nr = 4; +?????????????????????? if (nr > limit) +?????????????????????????????? nr = limit; +?????????????? } else { +?????????????????????? nr = floor; +?????????????? } ??????? } ??????? time = local_clock();