From patchwork Wed Nov 22 13:39:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 16935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1329060vqb; Wed, 22 Nov 2023 05:39:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9b0SwR8VSuLdhcTYa8PPwcWOpTw5rIPUmdwAvQU0g7R8QYviuBjnYYL+AVDNm3A5o87fi X-Received: by 2002:a05:6a20:144f:b0:187:ef24:358 with SMTP id a15-20020a056a20144f00b00187ef240358mr2391425pzi.60.1700660366706; Wed, 22 Nov 2023 05:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700660366; cv=none; d=google.com; s=arc-20160816; b=OEnt2FQV1hEIILY7qfoz3r25kpjUPnGGTIMix+XSm0Wh9ciEKUpHaoWfxoIpj8x8hG ZrhWoPm9ioDek9vsH7pnB8D7GUDkL4WnbNoxHPat96epDYJa8qtNXFaxLNlMQ+BbOCVN E0d+C8dv7cMb1jFFDUkWM4nltE6eyNN3a19GXpyte4bzxebs1CGLK4+GAitysO0FnRjs itC4uQM46+DlOQbf44XPTQC2WlhCSOdmUZ6b4W8pAFNVX5aUfICYnXpAX75srwNmc44d PPvdhajMlF+N8j1LQMZolzCliGYDMGGNx1QBug+dGgJJ3mpaKvY13HHzGwG4rOCM2HRA pnOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IbsclafXVbhvsS395bqo3weKnHOeQwA8LuBg6N0OZoI=; fh=3TTsVLri5uVG5k6QxKPRU5Fzak9FoO4yptSAdhI1VBc=; b=dIUb63DBTCksETtE3S2C4F1dbpON595552H7q6ERFc+dGGZxWEvgPA1jT8gIJoVh9Q AwSeXYaRDNXGgIF5wVkD02gYAmH9E/MiS+ubJmnUk3ux7VG4dw230QURoGlytngzlm5J Ues5I3kV1CeFUl/M91m8VVSEKgmHNS8dUbtWCYDNBzNsCweBkny/1wJNF6DjNp56dYON vutnR35UsU99VOTU0gMXImmzwZSvlbWyHXmwTasiZFOKPDvfU0TJDdxSNIOnB3Q1wnVF eNQJgiwGP6hSC1UzbJ0E/ChVshPx26l+8LItMQ6+U3D5walXcThuItBAuwlR2t3vPIt0 jPlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s9/ogQDn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id v67-20020a632f46000000b005c1b2e0b12fsi11854175pgv.372.2023.11.22.05.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 05:39:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s9/ogQDn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8970982372D8; Wed, 22 Nov 2023 05:39:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344043AbjKVNjQ (ORCPT + 99 others); Wed, 22 Nov 2023 08:39:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343968AbjKVNjP (ORCPT ); Wed, 22 Nov 2023 08:39:15 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D402FD54 for ; Wed, 22 Nov 2023 05:39:11 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40b344101f2so934375e9.0 for ; Wed, 22 Nov 2023 05:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700660350; x=1701265150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IbsclafXVbhvsS395bqo3weKnHOeQwA8LuBg6N0OZoI=; b=s9/ogQDn14KWxJpVfgJ8ef3vbg35WtFMAN9FUzrGRWgPxpDpx1RUhyXj5ia4caA5Cd UhmYMNHXJQ1LEpSNPFzC7DhaPzdV8dplJzXr19FAMrInGy79uiqQfpotVcEKUVeWehds LbG6QtJMzkGKApU4lKD8qo+1UPlQtjrotD3NLhCPqgfLd3DqPT0cRLSARHz0O3Pt09W/ CZ4KYppzCbOzKUPQZ/73Jvc0ZNbgba6MgLfLBOVu6sfwYU3FGAXkXvXvU5juhsfJS7mv X6s1yW1vYzneSCSeIIXrR5dbxksus/jdcqFG+wtiAI4HUiH/j7NKw6ovbQFJxjj6BVPD 2owA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700660350; x=1701265150; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IbsclafXVbhvsS395bqo3weKnHOeQwA8LuBg6N0OZoI=; b=TmPPrX3sYGE/dAyWZpnoHe0AmyWQMMa5DbTxqqGxnuNb7ZATtojEp+4a4COOKvMvO2 +HfEAGNcqk9clw7ZvZqVuSYwgjp8tSVus8gCWCxaubyCYKZ16ozp3Q83nuP9CwP76Go3 YwdyDMMkltJMVOY5H+8y2rbwgJ5wx0Bfra1s4uDiSSlHzyLD5tyXeHgOV5LialCeRvfJ VM5hnKE0ScxRuwuVlepYkHH6oQvIdLGJK6tcsz+STqIqPa1IKeASNH5yxkUNOvMoyhVQ NzHaumaLoWiEzlWTkMTw2sq5FQ3oc4//MfzDNBal+vDmhqAXZWNZaoUfDIFqXAIvPhvJ 9D2w== X-Gm-Message-State: AOJu0Yziq8TogmIndd1aiDS/4+1OUg0RiFoTouKpESez7T/zKdTRgR30 zbKRrnL1j/Sb0Xx7q6sbYaq5DQ== X-Received: by 2002:a05:600c:1503:b0:407:4126:f71c with SMTP id b3-20020a05600c150300b004074126f71cmr5521605wmg.6.1700660350268; Wed, 22 Nov 2023 05:39:10 -0800 (PST) Received: from vingu-book.. ([2a01:e0a:f:6020:3a2e:a7f5:93e6:508b]) by smtp.gmail.com with ESMTPSA id o31-20020a05600c511f00b00407752bd834sm2307386wms.1.2023.11.22.05.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 05:39:09 -0800 (PST) From: Vincent Guittot To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, rafael@kernel.org, viresh.kumar@linaro.org, qyousef@layalina.io, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: lukasz.luba@arm.com, wyes.karny@amd.com, beata.michalska@arm.com, Vincent Guittot Subject: [PATCH v4 0/2] Rework interface between scheduler and schedutil governor Date: Wed, 22 Nov 2023 14:39:02 +0100 Message-Id: <20231122133904.446032-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 05:39:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783271644740323022 X-GMAIL-MSGID: 1783271644740323022 Following the discussion with Qais [1] about how to handle uclamp requirements and after syncing with him, we agreed that I should move forward on the patchset to rework the interface between scheduler and schedutil governor to provide more information to the latter. Scheduler (and EAS in particular) doesn't need anymore to guess estimate which headroom the governor wants to apply and will directly ask for the target freq. Then the governor directly gets the actual utilization and new minimum and maximum boundaries to select this target frequency and doesn't have to deal anymore with scheduler internals like uclamp when including iowait boost. [1] https://lore.kernel.org/lkml/CAKfTPtA5JqNCauG-rP3wGfq+p8EEVx9Tvwj6ksM3SYCwRmfCTg@mail.gmail.com/ Changes since v3: - Fix freq selection with runnable RT Changes since v2: - remove useless target variable Changes since v1: - fix a bug (always set max even when returning early) - fix typos Vincent Guittot (2): sched/schedutil: Rework performance estimation sched/schedutil: Rework iowait boost include/linux/energy_model.h | 1 - kernel/sched/core.c | 90 ++++++++++++++------------------ kernel/sched/cpufreq_schedutil.c | 64 ++++++++++++++--------- kernel/sched/fair.c | 22 ++++++-- kernel/sched/sched.h | 84 +++-------------------------- 5 files changed, 103 insertions(+), 158 deletions(-)