Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp918565rdb; Sun, 20 Aug 2023 08:31:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBTJxa+PxTomxycWskAAnMdV0ZXLk+HlBMS5FjUA2JE06neJoVCzLKpLW8ioAs0hzADIVj X-Received: by 2002:a05:6830:1bf3:b0:6b9:9018:6ea with SMTP id k19-20020a0568301bf300b006b9901806eamr6332880otb.20.1692545502700; Sun, 20 Aug 2023 08:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692545502; cv=none; d=google.com; s=arc-20160816; b=uQWq2epFZPRuCEyHGl9449fO5kIx4KInxpyhcOGtyrvFkKgl8tpCXwTSsMmZTTdx13 E0HFyZnmTlM1UbMUY/qtWsX7fz7p/aU99DfTyyTdqcuIcWcdn1Wq1pMJbVfsYTdMIpbi dzx2sP7Li/KWy3gYAoXSe8ml1/eTOZaxaxEmADC8Gd64VY3mZmkV6bb275MWoywyuT2i wgRZS+I/ETSkLfILSyeAu/+iJEE5pEZEzdVWacIzRtb74r78FEk/RKYfTGe+WZcPgYFL stonBIfbWvjlbPhMZQjTLmaVkTdnbYBFBQQg6S04kxuJB49ZchhjmCMlCCiR+djvNPnp O2LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=t3vLaE4TYcgTiQe0ygAN8Ah0CEoFUzrA+vIOHyd9hKI=; fh=87IInrrNvefB2xU8cn2pAHq3VVJm1RH1/GLeIJrSdNM=; b=K37hFSn/QXFvqqZ2mEUiLtCDDDscQkzxs/27PTRjjAb8dgx5LXWPyooDoaXB4oRvxo CC+jTeLwB118Xncqhw/wuHjmdpkjr6Ar/Ueu2P5gL/IMhtvcs3JaAy/qOPYo5l8DmjzL fmZTHZ51u7Xc/ZXXevWpbpGWyyuYjwFscGIRbbSuUn2NMmUO8aneCQ/A5OKpdhIm/2Rf CyObKTXorqB/ClWq6+m/mvi/kmE9g6+hwn61ATZJebgFxvQYwizHM8lCnzQikxtX5qzj a6ihhMFLRIpsgQtRA7R+KaIkWMrF9kc0F5TQnfLE5LgHOuZqk8SxDUqu5eCJY+UkQwmo ft6A== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h188-20020a636cc5000000b005634b511d76si5066860pgc.31.2023.08.20.08.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 08:31:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7ED9539BA39; Sat, 19 Aug 2023 12:14:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349613AbjHQJ3n convert rfc822-to-8bit (ORCPT + 99 others); Thu, 17 Aug 2023 05:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349645AbjHQJ3h (ORCPT ); Thu, 17 Aug 2023 05:29:37 -0400 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 389062712; Thu, 17 Aug 2023 02:29:36 -0700 (PDT) Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-56d75fb64a6so1195048eaf.0; Thu, 17 Aug 2023 02:29:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692264575; x=1692869375; h=content-transfer-encoding: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=fdGsfXep5TF4hCEmFfRAcBljG6Erf6EGHttd193Zeq8=; b=MzHFIOsZLyPsb5NH7pdfnRmFJjHBMD9u9PnIMKQaWAqcqnFeaS1spYLaf1Eu/H2xEr r98/q2UdoQKqQQz1UuABN8HVFJs8JCJJaBzZZmhtbOS24kuyMtKMd48yHEoOsgfJ+fLJ dDQnW647ZI4Un7BeP5BQs6HqyTd/zk17HdVA+DSMqP4xtF2Dz5b/gYAgyLQTLmWi+3ah HC9ID5mu3kBBE2mAhuRgmPBFT5J3IX+PTl8STWJwg1DXyjmIlp2Hga58e03XVwnuasAD x3xO35iSPIADgk/YQtJIbWlUGTYoaTzmIJH1mpFEqxV0UpS+8hReVnaaEhfruVSmY6yT ey4A== X-Gm-Message-State: AOJu0Ywq1nYPZI3hsh94ZdnD+zABQ+TW6mEZPmXcO//gtQDczpvDc79Q 4a5L76phBBZO1qa8H8GwQpCp2WqBLDsYv3OiS40= X-Received: by 2002:a4a:c90f:0:b0:566:951e:140c with SMTP id v15-20020a4ac90f000000b00566951e140cmr4268028ooq.1.1692264575427; Thu, 17 Aug 2023 02:29:35 -0700 (PDT) MIME-Version: 1.0 References: <12275372.O9o76ZdvQC@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 17 Aug 2023 11:29:15 +0200 Message-ID: Subject: Re: [RFT] [PATCH v2] cpuidle: menu: Skip tick_nohz_get_sleep_length() call in some cases To: Doug Smythies Cc: "Rafael J. Wysocki" , Linux PM , Anna-Maria Behnsen , Peter Zijlstra , LKML , Frederic Weisbecker , Kajetan Puchalski , Srinivas Pandruvada Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 Mon, Aug 14, 2023 at 4:52 PM Doug Smythies wrote: > > On Thu, Aug 10, 2023 at 11:38 AM Rafael J. Wysocki wrote: > > > > From: Rafael J. Wysocki > > Subject: [PATCH] cpuidle: menu: Skip tick_nohz_get_sleep_length() call in some cases > > > > Because the cost of calling tick_nohz_get_sleep_length() may increase > > in the future, reorder the code in menu_select() so it first uses the > > statistics to determine the expected idle duration. If that value is > > higher than RESIDENCY_THRESHOLD_NS, tick_nohz_get_sleep_length() will > > be called to obtain the time till the closest timer and refine the > > idle duration prediction if necessary. > > > > This causes the governor to always take the full overhead of > > get_typical_interval() with the assumption that the cost will be > > amortized by skipping the tick_nohz_get_sleep_length() call in the > > cases when the predicted idle duration is relatively very small. > > > > Signed-off-by: Rafael J. Wysocki > > I ran the same tests as I did for the teo governor changes. > Nothing of significance to report (well, some minor improvements > in records per second at the long interval end of the sleeping > ebizzy test, with a corresponding slight increase in processor > package power). > > Tested-by: Doug Smythies Thank you!