Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4278018ivc; Tue, 3 Nov 2020 07:40:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxljllS0Qn3mifllarRUHE4RFNoGIi0sQrG1KuqXi8CQ0am85Fq9gzSTW3HKrVsXuD7PxV1 X-Received: by 2002:a50:d2c5:: with SMTP id q5mr12364737edg.158.1604418013609; Tue, 03 Nov 2020 07:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604418013; cv=none; d=google.com; s=arc-20160816; b=XhIZedlY+DTuive18VdR56tN8tPvU6p31JaKcZTrnoZ28cyESDWWWzZFRY1sEys4dK Fw4s/+YIwNB4PerLkOuc86MtHLdcCqlcDpUtTFJmeVAaz8ecQ1Eb1UJrD+u0x3/gXq4T 5o4+JT7JGbGREu1aNYRqyCj0bbBX8EAvwZdwTxcPmgOJIcIrFOplGH/NcCPSysqFhwKk enldq33STnpFOenP0Y/WX80j7GI4l8UPqF1Fk5L8HMdOYTeo1+8ub0OzX/hitk7QOY89 7EbD2uGCEp5vYsjFaeMNGujBIeh2LFVtFrzzrPZnlG7vooqfbkvP+VHU2rVO7FQ7/NqZ Rktg== 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 :to:subject; bh=DaLctY/baaQUsQYxmBl8XgM/fybgVjPUxD289pDpr7g=; b=0USFpUI/o18bZBOMw5NyU7f+TBZ5SZSsXZgftg5ZMFRNqF4NFRXmYm1BuhHQKCP5/I xutxz3PRgq83U9CQ1LGrZbr3e1ZqHB3kehLQ23jZZZTg2T1RyqAb802lQ20FzDNthP5M DT/wcUXEM4Qa0z/GMwpNjVAjRoM8UZbdy9V8kQr+hiHRgAdHmsRT1IJ7Kzll8eOFsUxS b/TlEEbcxbY1wydG+JUyxJs1aSTEdlbOsCERAqMskp+ZF9l5s2TWGx4ycrX4lpsMZFaR M6JAqF+gBBEYbZ8UDXpzBBqWU2RAKVKpNPtITZgYjU/dkCcNOrvPujaEVZyeELcHQRWr SuqQ== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si3150054ejq.520.2020.11.03.07.39.50; Tue, 03 Nov 2020 07:40:13 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728029AbgKCPgX (ORCPT + 99 others); Tue, 3 Nov 2020 10:36:23 -0500 Received: from foss.arm.com ([217.140.110.172]:50738 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726388AbgKCPgX (ORCPT ); Tue, 3 Nov 2020 10:36:23 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BF4A7139F; Tue, 3 Nov 2020 07:36:22 -0800 (PST) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6A5313F66E; Tue, 3 Nov 2020 07:36:20 -0800 (PST) Subject: Re: [PATCH v3] sched/fair: prefer prev cpu in asymmetric wakeup path To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, valentin.schneider@arm.com, morten.rasmussen@arm.com, ouwen210@hotmail.com References: <20201029161824.26389-1-vincent.guittot@linaro.org> From: Dietmar Eggemann Message-ID: <67e245f8-eff3-98e2-68aa-04376f886385@arm.com> Date: Tue, 3 Nov 2020 16:36:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201029161824.26389-1-vincent.guittot@linaro.org> 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 29/10/2020 17:18, Vincent Guittot wrote: [...] > - On hikey960 with performance governor (EAS disable) > > ./perf bench sched pipe -T -l 50000 > mainline w/ patch > # migrations 999364 0 > ops/sec 149313(+/-0.28%) 182587(+/- 0.40) +22% > > - On hikey with performance governor > > ./perf bench sched pipe -T -l 50000 > mainline w/ patch > # migrations 0 0 > ops/sec 47721(+/-0.76%) 47899(+/- 0.56) +0.4% Tested on hikey960 (big cluster 0xf0) with perf gov on tip sched/core + patch) and defconfig plus: # CONFIG_ARM_CPUIDLE is not set # CONFIG_CPU_THERMAL is not set # CONFIG_HISI_THERMAL is not set and for 'w/ uclamp' tests: CONFIG_UCLAMP_TASK=y CONFIG_UCLAMP_BUCKETS_COUNT=5 CONFIG_UCLAMP_TASK_GROUP=y (a) perf stat -n -r 20 taskset 0xf0 perf bench sched pipe -T -l 50000 (b) perf stat -n -r 20 -- cgexec -g cpu:A/B taskset 0xf0 perf bench sched pipe -T -l 50000 (1) w/o uclamp (a) w/o patch: 0.392850 +- 0.000289 seconds time elapsed ( +- 0.07% ) w/ patch: 0.330786 +- 0.000401 seconds time elapsed ( +- 0.12% ) (b) w/o patch: 0.414644 +- 0.000375 seconds time elapsed ( +- 0.09% ) w/ patch: 0.353113 +- 0.000393 seconds time elapsed ( +- 0.11% ) (2) w/ uclamp (a) w/o patch: 0.393781 +- 0.000488 seconds time elapsed ( +- 0.12% ) w/ patch: 0.342726 +- 0.000661 seconds time elapsed ( +- 0.19% ) (b) w/o patch: 0.416645 +- 0.000520 seconds time elapsed ( +- 0.12% ) w/ patch: 0.358098 +- 0.000577 seconds time elapsed ( +- 0.16% ) Tested-by: Dietmar Eggemann > According to test on hikey, the patch doesn't impact symmetric system > compared to current implementation (only tested on arm64) > > Also read the uclamped value of task's utilization at most twice instead > instead each time we compare task's utilization with cpu's capacity. task_util could be passed into select_idle_capacity() avoiding the second call to uclamp_task_util()? With this I see a small improvement for (a) (3) w/ uclamp and passing task_util into sic() (a) w/ patch: 0.337032 +- 0.000564 seconds time elapsed ( +- 0.17% ) (b) w/ patch: 0.358467 +- 0.000381 seconds time elapsed ( +- 0.11% ) [...] > -symmetric: > - if (available_idle_cpu(target) || sched_idle_cpu(target)) > + if ((available_idle_cpu(target) || sched_idle_cpu(target)) && > + asym_fits_capacity(task_util, target)) > return target; Braces because of multi-line condition ? > /* > * If the previous CPU is cache affine and idle, don't be stupid: > */ > if (prev != target && cpus_share_cache(prev, target) && > - (available_idle_cpu(prev) || sched_idle_cpu(prev))) > + (available_idle_cpu(prev) || sched_idle_cpu(prev)) && > + asym_fits_capacity(task_util, prev)) > return prev; and here ... [...]