Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp31704rdb; Mon, 14 Aug 2023 08:41:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEi9ipoVirlwg6F6RnmusKik+Kgemuz0LrJrBPJ2O6Fy6Cdufun75v29y/Z9yHf+x+IB/Wx X-Received: by 2002:a17:906:1ba9:b0:992:ef60:ab0d with SMTP id r9-20020a1709061ba900b00992ef60ab0dmr6987701ejg.69.1692027659868; Mon, 14 Aug 2023 08:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692027659; cv=none; d=google.com; s=arc-20160816; b=gHl+KDM6bhmisDmFLorY69O/455TxJItW8ZSydfCBdp4YVyaYCH+lUSGlvgZCTr+gf AmTgq8qKrvJnlmMdnfwxDQp/wnGChDM/AkNQMCtFsBN5GUQE2F2gAFZRVQPa7hYZKp2L F+t7qvw5Rizn0FmtdjZ9OO6dkkNvW19EeXIbw0MWYcPcxaTDGyZxeahHjfi7VpDVDsVf evm7zMgDkBn19V5su+9vEAYIMJHVqPmaCPlo/a2+fGJTw1r6ao18NN8Y76SDDrQwSq+V 9f+NMwtuKQSmP2Ud+mnFqgD/G7r8Og/fRfi44U2Az1irZ0fYIGWrDfmsV6xDxzrcF+87 oZbQ== 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 :dkim-signature; bh=QKUbWP/5wD+R2VLBW3T27yTkiHC3+pkgzxkv5KBw7oU=; fh=hqpOfgZGcxmlhsW4OTSzFNtEyrprsrsORzvCoG/nysc=; b=P3i6oKUD2E7gCegCyeq9ZLBvGjXE6Dw6ZJlNDwrJYeYcj15I3z3VoIm3bWqAoNuXDU 9R3OBPhrT5+jadzjVHvUg4ujzuc+vbWbnU5AaR4PzTt1BqcZNEGqoM2A1CoHhVTaHw4D xvoH/x/Y4uB1h8sDXjhk8imaxKrU5QLuO89qM3wHaM8jepF1ipfkrY4MqWceS1fn0OeO VbZ/4TaoOzOrqoYw8qrw2qTp0w3rxqt3NfYx3pQrIPsq0mGlgzXtreR9nNcSWIuQRifA PV+pctWrIaa/rYKA7vdDM0BnoCTUDXOe3koopJGmt/DK/NDMXxu07Qz8JLUfpuDM7m58 be/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=NWMm8VPX; 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=telus.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k24-20020a170906971800b00988ce720dedsi7330330ejx.541.2023.08.14.08.40.35; Mon, 14 Aug 2023 08:40:59 -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; dkim=pass header.i=@telus.net header.s=google header.b=NWMm8VPX; 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=telus.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232482AbjHNOwW (ORCPT + 99 others); Mon, 14 Aug 2023 10:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbjHNOvx (ORCPT ); Mon, 14 Aug 2023 10:51:53 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6660818F for ; Mon, 14 Aug 2023 07:51:52 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso3914584f8f.0 for ; Mon, 14 Aug 2023 07:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; t=1692024711; x=1692629511; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QKUbWP/5wD+R2VLBW3T27yTkiHC3+pkgzxkv5KBw7oU=; b=NWMm8VPXlx1C0KCYzCe2DHfP0ywDplps9vTIQABh7xZoJm7n121tukAMxAJkOEcKO1 0xqtrcZb5TkS2OkP8NvwgtnoL5TAP072lBKrIlWawF3Ew0KTiF9Kox9etTzy+vL5rZcK sCiesV6PZKDzp4Wf53mfDZkd52w9eAFV/TKXBw9fXJ1k4uA+h15fZObpyGfK/HcUssVy B5k4eymGhpX0E42pGWsbggffH7svbOgwN5J6MgJBQ2Bws+/JKTEPVFpX09EJFzvp9jwF 8Im/hZajaQu70a0c4GjxLLdEhXKqo7mNEomTbXuKkRmUM19ggJSLjxvA/cGAMxTEqQOB kUVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692024711; x=1692629511; 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=QKUbWP/5wD+R2VLBW3T27yTkiHC3+pkgzxkv5KBw7oU=; b=OnXoQMwajDY3WSTvaOcbYO8jhMm6PTxf4LNWboAl/30d+Ppxhmc2CgJGKNmhdpczLL tqxLYQM1xqqS+wlaPfMDJIFZCruMGUJdGzE/r+IRcmi0fPpsuUO3CyPf907NivgXgsb0 sNCYaRuwE5nUReRgDP5vfRcmAhTbq9qmmIjjgA3k5jK4JWiXIPcKpbnFi8IaRU4nJBYj D5v2rw3DcBE7XKVioYUzCxwNUiyOVchbkvuJayCDFq8K0ikzOasj0EMFoAWNyOAQ7uXI +SlQ2orGmSklYiZArh5v6wrIXIRGsYFAAVnmxux6lCDJdoM39iPYkhOmpMameM4otTxq KUeQ== X-Gm-Message-State: AOJu0YyeeqTgeGX6gszLzto3rEu5w+Po8E76mBE119t7ob5ok9jIOWyr IfQ3hyMWUCQG62VdQzIS9EGixy+NaFpqfehOli0RTjJ/MQMmnR2h X-Received: by 2002:a5d:618d:0:b0:313:f783:262b with SMTP id j13-20020a5d618d000000b00313f783262bmr6915039wru.26.1692024710910; Mon, 14 Aug 2023 07:51:50 -0700 (PDT) MIME-Version: 1.0 References: <12275372.O9o76ZdvQC@kreacher> In-Reply-To: <12275372.O9o76ZdvQC@kreacher> From: Doug Smythies Date: Mon, 14 Aug 2023 07:51:41 -0700 Message-ID: Subject: Re: [RFT] [PATCH v2] cpuidle: menu: Skip tick_nohz_get_sleep_length() call in some cases To: "Rafael J. Wysocki" Cc: Linux PM , Anna-Maria Behnsen , Peter Zijlstra , LKML , Frederic Weisbecker , Kajetan Puchalski , Srinivas Pandruvada , Doug Smythies Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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, Aug 10, 2023 at 11:38=E2=80=AFAM 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 > --- > > v1 -> v2: Add missing max check to get_typical_interval(). > ... Doug