Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3318459pxu; Tue, 15 Dec 2020 04:17:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoX32hGCjng7znRcMtMF6G9YiTH46eNWIEIMWillr+xxn1xXclwRuUEv2a3jfubS2OOowW X-Received: by 2002:a50:a684:: with SMTP id e4mr12325638edc.148.1608034676903; Tue, 15 Dec 2020 04:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608034676; cv=none; d=google.com; s=arc-20160816; b=A1u90/Wkdd2yO8rFF+oxWV+BiE0dGZU4akbbvU2EYcaE+zjBYLaROsubGCeImKBJ4u 5BjSHqn/VBi+WN0EzmJ1yv+A0AwyI5OMrnm4NBhG2XHQbdyXT3zCfDp9SW8fvGCNDuG3 rpe28sOn1OcqbIAyWOZcGbvRkiqh6jgYUh9d21gNdJJNtB/Yew0zn99gRpEAzS7scxQ2 A3FCOev1ckJL3tvfTicSATwbsiiS4/BGNrc4LnU+97RiFmiT6UAwJPPSh0XaarbVL/bj mHQmBk8YqRNRi9XkHXgVNPsbl94n/g2U7X2N2Il59pB3sUmGwHoAaLd4A6z/COXBncoV G2hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=ie1rb3fVuwqTQDbwGmgIQ36uLNTLwIaNMbUQwA0FQxk=; b=bZhN9u9ZummGJOrwQBUtbyY3idklL1n5r5KPYYPNKm7w+gTVCcJpqkrUPy2uErCe+O efzUAWc7mjBResnRPcc3sFKON9fjO9JNlsQddr/L209/GgLDMkdCc9cxmHuc50age6QB e8Nv54R0NTSULWUY4LtEBG9cEQlVwYZ4L51loJaT15fg34G2y1/AvcmgYTxa+Qxf1hwz IW3enyufRD7hq26BLWiWI6e6NsS9YGdue2TOSLVLN/eEdX2ZOgzeqI+MSN+HIuoGYtRE mNl/Q2fP72O/bjOe4c8rwbEcZYM1TviuUmh1kp7+8/892u8ZHN6FyqCyTvT1C8EIee2k JhfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dv23si727100ejb.408.2020.12.15.04.17.32; Tue, 15 Dec 2020 04:17:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727167AbgLOMO5 (ORCPT + 99 others); Tue, 15 Dec 2020 07:14:57 -0500 Received: from mga09.intel.com ([134.134.136.24]:46563 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgLOMO4 (ORCPT ); Tue, 15 Dec 2020 07:14:56 -0500 IronPort-SDR: eJHLkP9lExaywZucswweuThWNZWESlDy92wjQG8UuwGgTkVu/16yRj+KlqyptAwsxv9AquyVw+ lpytWFnmDgoQ== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="175011333" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="175011333" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2020 04:13:10 -0800 IronPort-SDR: IFxsBVE6eMXGs+O+Ka4TEF45X9NKcB0cm+3+OfxpQy73jlEnTwolO/ucKXXv+fV62Xs0Myonlw sZY3FtFFncSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="383513847" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.125]) ([10.239.161.125]) by fmsmga004.fm.intel.com with ESMTP; 15 Dec 2020 04:13:07 -0800 Subject: Re: [RFC][PATCH 1/5] sched/fair: Fix select_idle_cpu()s cost accounting To: Peter Zijlstra Cc: mgorman@techsingularity.net, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, mingo@redhat.com, juri.lelli@redhat.com, valentin.schneider@arm.com, qais.yousef@arm.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, tim.c.chen@linux.intel.com, benbjiang@gmail.com References: <20201214164822.402812729@infradead.org> <20201214170017.877557652@infradead.org> <20201215075911.GA3040@hirez.programming.kicks-ass.net> From: "Li, Aubrey" Message-ID: Date: Tue, 15 Dec 2020 20:13:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20201215075911.GA3040@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/15 15:59, Peter Zijlstra wrote: > On Tue, Dec 15, 2020 at 11:36:35AM +0800, Li, Aubrey wrote: >> On 2020/12/15 0:48, Peter Zijlstra wrote: >>> We compute the average cost of the total scan, but then use it as a >>> per-cpu scan cost when computing the scan proportion. Fix this by >>> properly computing a per-cpu scan cost. >>> >>> This also fixes a bug where we would terminate early (!--nr, case) and >>> not account that cost at all. >> >> I'm a bit worried this may introduce a regression under heavy load. >> The overhead of adding another cpu_clock() and calculation becomes >> significant when sis_scan is throttled by nr. > > The thing is, the code as it exists today makes no sense what so ever. > It's plain broken batshit. > > We calculate the total scanning time (irrespective of how many CPUs we > touched), and then use that calculate the number of cpus to scan. That's > just daft. > > After this patch we calculate the avg cost of scanning 1 cpu and use > that to calculate how many cpus to scan. Which is coherent and sane. I see and all of these make sense to me. > > Maybe it can be improved, but that's a completely different thing. > OK, I'll go through the workloads in hand and paste the data here. Thanks, -Aubrey