Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2406021rwi; Fri, 28 Oct 2022 06:47:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d3IGC0kPjr5nF1y+1RtB62HNjdN1HFyIC/Lq5HSvxCdS7Efid08cK0VyUNFQlr4q6KSCQ X-Received: by 2002:a17:907:7e9e:b0:78d:f3b0:fc78 with SMTP id qb30-20020a1709077e9e00b0078df3b0fc78mr47979987ejc.478.1666964870879; Fri, 28 Oct 2022 06:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666964870; cv=none; d=google.com; s=arc-20160816; b=lsM3k+utyZS+pg+Bzy+PNWUWOk8CNAQpnSSFI3TkqC8vCT1LBXFNz83xOK5xaDwsLq J+4kPUbHAO3mcpn5ClENelrMcDrcinDx7P/1WB0C8D/pUbO/SYIhS962MNcudOQcGUh4 8PAO5bM7VI/H1I8HxqnAVj0cApOFG6G9QGC1xRd+xSTvO/GxnOMkBECyDK55+OMD35c1 uDppGZx1nulfaqbYsYU79FjGR5O2w4Mwx0UVuETgVt+Ag/eeZtKc0lri3TKhPhiLtGhY oVSVZbQEW4evJPfCJsCYIAfmkLw1pS5E3JT8GYi5nvF6XyrL1KPWm3xVGO0scsxLJY8C e/PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Ewf1/0yS/MPVhCM+bumhxUWSJIhluAl1yOgoepsPDa4=; b=gPyO5UvmqdQWIMPhQ1XgpGV40lrtHojo1hKRbZuaF9Iqw8gZPCTmYr9/Pj6uEOzhwb fbfGhRmG2ljf8K2Lp7xQsBn77jVSmaswlocUdzmfAWTNcLErqpPKtY9PzOjbTxjUZGot PLaIwvgallpCj46UZO4thmbfiRf41HMXmSgbELKZTYHp/HlZWA+kIW82I1nXI42H2TV3 2fCqQWIc4Dwt0DHOt3Kb8xX/cu8jnLZlOgNgJ1lCUJwlRgbAGMHZMmUSMXcYscfDpa0C hASilMCLSmwDwXSwFMrj0phdIK/Q5GUEZTNQhC8dJpVObjPQJTZLY2Wbg2qARlUSdNcC sYRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170906601000b007417e9a2c71si4108861ejj.352.2022.10.28.06.47.25; Fri, 28 Oct 2022 06:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbiJ1N31 (ORCPT + 99 others); Fri, 28 Oct 2022 09:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbiJ1N3U (ORCPT ); Fri, 28 Oct 2022 09:29:20 -0400 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC422792E6; Fri, 28 Oct 2022 06:29:19 -0700 (PDT) Received: by mail-qv1-f45.google.com with SMTP id c8so4026874qvn.10; Fri, 28 Oct 2022 06:29:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ewf1/0yS/MPVhCM+bumhxUWSJIhluAl1yOgoepsPDa4=; b=vq51oE0CjsKMLZlgeai7ShOdfS53y13/NgTUZZMTPJ7+bp86Om0jTXHgq5YC5qFAb/ KaQTQ5tIPcEQtnbAgAGSVJs/CRfg1vikWn+psTDZenzPymU/X3R+0f4DLvfKpUnSoOYX PxPZSBKv+YzvUxiQ2ukVGvWRfsj+EpWkdM6HewN9Dl5a06coshTviaFgqi7q1G/8aVDX vi3OnEZrMaxWvDtzqXiTsenIUII3G2aWsW3sSYIpE7uAb/gTnt8UWjIotT8N0qZ2PGVK 0HrGg/OgNS0i+EMQOQ3f9VhWx/+iiPiB62SOyFf6aEcjqgrhJLbSkUarq5sgJA5pD1GG 6RgQ== X-Gm-Message-State: ACrzQf0nO9uTmoFXd1+poUpxHNYksuW/5onZ2fEQxRyjsvSfiiwJe5eQ eBPV4ai2TRUCUSO/qi9jCS+YiZJT52alluvNAlY= X-Received: by 2002:ad4:596b:0:b0:4b1:ee66:1cb8 with SMTP id eq11-20020ad4596b000000b004b1ee661cb8mr45829729qvb.3.1666963758929; Fri, 28 Oct 2022 06:29:18 -0700 (PDT) MIME-Version: 1.0 References: <20221003144914.160547-1-kajetan.puchalski@arm.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 28 Oct 2022 15:29:07 +0200 Message-ID: Subject: Re: [RFC PATCH v2 0/1] cpuidle: teo: Introduce optional util-awareness To: Lukasz Luba Cc: Doug Smythies , "Rafael J. Wysocki" , daniel.lezcano@linaro.org, Dietmar.Eggemann@arm.com, yu.chen.surf@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kajetan Puchalski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 27, 2022 at 9:56 PM Lukasz Luba wrote: > > Hi Doug, > > Thank you for your effort in testing these patches and different > governors. We really appreciate that, since this helped us to > better understand the platform that you are using. It is different > to what we have and our workloads. That's why I have some comments. > > It would be hard to combine these two worlds and requirements. > I have some concerns to the tests, the setup and the platform. > I can see a reason why this patch has to prove the > strengths on this platform and environment. > Please see my comments below. > > On 10/13/22 23:12, Doug Smythies wrote: > > Hi All, > > > > On Thu, Oct 13, 2022 at 4:12 AM Kajetan Puchalski > > wrote: > >> On Wed, Oct 12, 2022 at 08:50:39PM +0200, Rafael J. Wysocki wrote: > >>> On Mon, Oct 3, 2022 at 4:50 PM Kajetan Puchalski > >>> wrote: > > ... > > > >> On the Intel & power usage angle you might have seen in the discussion, > >> Doug sent me some interesting data privately. As far as I can tell the > >> main issue there is that C0 on Intel doesn't actually do power saving so > >> moving the state selection down to it is a pretty bad idea because C1 > >> could be very close in terms of latency and save much more power. > >> > >> A potential solution could be altering the v2 to only decrease the state > >> selection by 1 if it's above 1, ie 2->1 but not 1->0. It's fine for us > >> because arm systems with 2 states use the early exit path anyway. It'd > >> just amount to changing this hunk: > >> > >> + if (cpu_data->utilized && idx > 0 && !dev->states_usage[idx-1].disable) > >> + idx--; > >> > >> to: > >> > >> + if (cpu_data->utilized && idx > 1 && !dev->states_usage[idx-1].disable) > >> + idx--; > >> > >> What would you think about that? Should make it much less intense for > >> Intel systems. > > > > I tested the above, which you sent me as patch version v2-2. > > > > By default, my Intel i5-10600K has 4 idle states: > > > > $ grep . /sys/devices/system/cpu/cpu7/cpuidle/state*/name > > /sys/devices/system/cpu/cpu7/cpuidle/state0/name:POLL > > This active polling state type worries me a bit. We don't have > such on our platforms. Our shallowest idle state is really different. > We don't have active polling and there is no need for such. So as I said in a reply to Kajetan, the way to go is to avoid them when you do this utilization-based optimization. CPUIDLE_FLAG_POLLING is for that and it is used already in the code. Moreover, as I said in the other message, IMO the utilization-based optimization makes the most sense when the current candidate state is state 1, so it may not make sense to do it on Intel systems at all.