From patchwork Fri Jun 28 09:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Loehle X-Patchwork-Id: 13715915 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26EE929CED; Fri, 28 Jun 2024 10:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719568929; cv=none; b=LNUKgBY7r88YvoJWktwfL8yJ3FEnc5go8e0K/P2/y2UdB9tpFLSJhDx6kg8jSAX0gN/k2g/1TeQa8XhTkR3VbASUZETjELVIlXNTdSW0j3Y6PuB78isic4HX2M+lxonZ4T9Vni5eV/cktAXNXWXdX8i0K9p+VIS8tmIjHqbTQ2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719568929; c=relaxed/simple; bh=ZkNJSSlCT/4JwimH+zpop/+O1LNC3e7Vr0kjmhJ2NNI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=CYcGixKyzaqzI0Q/Y2Yp1IiY/BkcdOMtNJbh7XGe/zutM0mDF8ECRhhyfPem3q6M4z9I1lY5ZJW4bRFwFnNvS39GwDDJqo9CLoQOU5suaGrnQVHiNEZIiF7+fIIkdzVGI9hXLgl4QpiVTQWC3eMCTLFUhx+XBYhTn/QGZbOSg2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 68FDB106F; Fri, 28 Jun 2024 03:02:31 -0700 (PDT) Received: from e127648.cambridge.arm.com (e127648.arm.com [10.1.30.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7648A3F6A8; Fri, 28 Jun 2024 03:02:03 -0700 (PDT) From: Christian Loehle To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org Cc: vincent.guittot@linaro.org, qyousef@layalina.io, peterz@infradead.org, daniel.lezcano@linaro.org, ulf.hansson@linaro.org, anna-maria@linutronix.de, dsmythies@telus.net, kajetan.puchalski@arm.com, lukasz.luba@arm.com, dietmar.eggemann@arm.com, Christian Loehle Subject: [PATCHv3 0/3] cpuidle: teo: Fixing utilization and intercept logic Date: Fri, 28 Jun 2024 10:59:52 +0100 Message-Id: <20240628095955.34096-1-christian.loehle@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi all, so my investigation into teo lead to the following fixes. 1/3: As discussed the utilization threshold is too high while there are benefits in certain workloads, there are quite a few regressions, too. Revert the Util-awareness patch. This in itself leads to regressions, but part of it can be offset by the later patches. See https://lore.kernel.org/lkml/CAKfTPtA6ZzRR-zMN7sodOW+N_P+GqwNv4tGR+aMB5VXRT2b5bg@mail.gmail.com/ 2/3: Remove the 'recent' intercept logic, see my findings in: https://lore.kernel.org/lkml/0ce2d536-1125-4df8-9a5b-0d5e389cd8af@arm.com/ I haven't found a way to salvage this properly, so I removed it. The regular intercept seems to decay fast enough to not need this, but we could change it if that turns out that we need this to be faster in ramp-up and decaying. 3/3: The rest of the intercept logic had issues, too. See the commit. Happy for anyone to take a look and test as well. Some numbers for context, comparing: - IO workload (intercept heavy). - Timer workload very low utilization (check for deepest state) - hackbench (high utilization) - Geekbench 5 on Pixel6 (high utilization) Tests 1 to 3 are on RK3399 with CONFIG_HZ=100. target_residencies: 1, 900, 2000 1. IO workload, 5 runs, results sorted, in read IOPS. fio --minimal --time_based --name=fiotest --filename=/dev/nvme0n1 --runtime=30 --rw=randread --bs=4k --ioengine=psync --iodepth=1 --direct=1 | cut -d \; -f 8; teo fixed v2: /dev/nvme0n1 [4599, 4658, 4692, 4694, 4720] /dev/mmcblk2 [5700, 5730, 5735, 5747, 5977] /dev/mmcblk1 [2052, 2054, 2066, 2067, 2073] teo mainline: /dev/nvme0n1 [3793, 3825, 3846, 3865, 3964] /dev/mmcblk2 [3831, 4110, 4154, 4203, 4228] /dev/mmcblk1 [1559, 1564, 1596, 1611, 1618] menu: /dev/nvme0n1 [2571, 2630, 2804, 2813, 2917] /dev/mmcblk2 [4181, 4260, 5062, 5260, 5329] /dev/mmcblk1 [1567, 1581, 1585, 1603, 1769] 2. Timer workload (through IO for my convenience