Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7534157ybi; Mon, 8 Jul 2019 23:51:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/UUfLabMz+6GO07tRHzkVx6IVU14i8keXpf6Ym5jE9A4aIc9TihGIIFPpCcfLDrwmFO7M X-Received: by 2002:a17:90a:3724:: with SMTP id u33mr30415581pjb.19.1562655103745; Mon, 08 Jul 2019 23:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562655103; cv=none; d=google.com; s=arc-20160816; b=tPLey3NbbA1gHJwz3RxX1pitBSwm2ufd+aUv3PGHlK51fVBCUeieA2FkiojKUajr8A PbjDO3w61MTzFwUVo1R2tXKozkyp9QF9BIOCKrEwJKFcgMrig8gXhdDJ8nQuRcSGD9nj SkEHgU50/75/LkIuu8UFNA9ydP4IAN0KPMOnzKwfgiDaWUMtSsQHHeuZPzxEMjPD1POG 2+1BemAPfh20Stmw3Isefx/Ng0ityENpWdnbQTCkI6CcXIxU50moexPfxG/GqMoK4/12 j7N3V4McN7rBSm5/ZFFdGeYOWolNidxH9I4eZjSPpclO/JAsKwgQxaeMsDBoEtzjdMKu h0RA== 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; bh=ii8UsH5Elf/Y7v3ZXq66I3D5hvstpMiGUJOQc95FiB0=; b=DudMU/SUQzIyTvBDR7Nybwuf48e3xvj3W3668iJryHspIiKDHatHoU+VeoCSvc1jiq bu/tFbGw+kgW+FqCGEPHhOkFL1YT+CpAvZL2bZISCNyUUglKy974x+S0HUV+QrT2zUng eSY3wFAzPx6OGDyk7SGQjaM80znrbCeREv9f7sUK+/O5Aor8weTAYGp26jzaYm7jc5E2 3QIMu6gmflLV6msxbuY60YYdM7q1kG0/4SHTXHB4aa04P85m7LH+91/N1Mi3qbOS9wKA pBnyZb5n8XooiaenXGx4hI27WBidMjm+WGJcgn1tCI2UcAxcCbQKwBPWznC5eRHIwd/R IItA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=dvyDiGzb; 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 u186si22124174pgd.532.2019.07.08.23.51.28; Mon, 08 Jul 2019 23:51:43 -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-2018-07-02 header.b=dvyDiGzb; 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 S1726222AbfGIGtk (ORCPT + 99 others); Tue, 9 Jul 2019 02:49:40 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33868 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfGIGtk (ORCPT ); Tue, 9 Jul 2019 02:49:40 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x696iEeB045896; Tue, 9 Jul 2019 06:48:57 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-2018-07-02; bh=ii8UsH5Elf/Y7v3ZXq66I3D5hvstpMiGUJOQc95FiB0=; b=dvyDiGzb7aGwx+2hxOPmVTySKjYie1i9xH7dfNFbcJPfLjdpSAm7aRMn8oq0Iwsya1rE OjUbPVp2KOWeC79K+ud806gHpv1ZxwyAuPBVAf6R0H7DOASz+piv+7XH42JetUymfSKO StgQq5DhSInRnedB0dv3RAClWrhKRr8WWy5MqeJCjAL++LhpnUe7GaDeZvQgCdlOJXIQ AQuD5wMi/jQKejUjsnWZGFBii4JAPJDJztf9CVsNuVmYyQCPkGT8uf//joe2S40yIxbN iZ3l2unklEOkHAX6T8hyn4kKFJKBjeWkG8Qwv9xa5hs5Rxo0v9uKcpCq2n1bePnohhRL Lw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2tjkkpjakw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 06:48:57 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x696lbYl023908; Tue, 9 Jul 2019 06:48:57 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2tmmh2s7p0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 06:48:57 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x696mtca012680; Tue, 9 Jul 2019 06:48:56 GMT Received: from Subhras-MacBook-Pro.local (/103.217.243.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Jul 2019 23:48:55 -0700 Subject: Re: [RFC 0/2] Optimize the idle CPU search To: Parth Shah , linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org References: <20190708045432.18774-1-parth@linux.ibm.com> <839c6cc8-b550-3066-d856-3c8a919cc318@oracle.com> <708a2726-628c-196b-1fc0-43067e1e740f@linux.ibm.com> From: Subhra Mazumdar Message-ID: Date: Tue, 9 Jul 2019 12:18:47 +0530 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <708a2726-628c-196b-1fc0-43067e1e740f@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=962 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090082 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9312 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1907090081 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/9/19 11:08 AM, Parth Shah wrote: > > On 7/9/19 5:38 AM, Subhra Mazumdar wrote: >> On 7/8/19 10:24 AM, Parth Shah wrote: >>> When searching for an idle_sibling, scheduler first iterates to search for >>> an idle core and then for an idle CPU. By maintaining the idle CPU mask >>> while iterating through idle cores, we can mark non-idle CPUs for which >>> idle CPU search would not have to iterate through again. This is especially >>> true in a moderately load system >>> >>> Optimize idle CPUs search by marking already found non idle CPUs during >>> idle core search. This reduces iteration count when searching for idle >>> CPUs, resulting in lower iteration count. >>> >> I believe this can co-exist with latency-nice? We can derive the 'nr' in >> select_idle_cpu from latency-nice and use the new mask to iterate. >> > I agree, can be done with latency-nice. > > Maybe something like below? > smt = nr_cpus / nr_cores > nr = smt + (p->latency_nice * (total_cpus-smt) / max_latency_nice) > > This limits lower bounds to 1 core and goes through all the cores if > latency_nice is maximum for a task. Yes I had similar in mind.