Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2964418rwb; Mon, 16 Jan 2023 01:41:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtA48z0bnLpdJypc0cas5ZLcgkm96zrpp1ueUMU+COapT5Ue8uVYaAshBB+472P2/CdHesq X-Received: by 2002:a05:6a20:9d93:b0:af:6d54:239a with SMTP id mu19-20020a056a209d9300b000af6d54239amr20798532pzb.38.1673862082302; Mon, 16 Jan 2023 01:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673862082; cv=none; d=google.com; s=arc-20160816; b=vsRz7IO5pI5K08sOExq1NurzaTH1hRAp4LoUXC+sMjFp1jer4Nio+xeYI3MdoEIbmp jToe8oUNEDuRxEuW3BEtSMmm/Rc+H8crM3glIwGDd/JyQgDBAqD9cSXLsoKUrBW7bKcd 738hVaxH9Epmpr+YrRtJCNoZjnuCCIixrwlJD5p22NAcERoVPIwdQm6O9B4vqmRLenT1 i+jpRIt7gy1mjgXMt+wecG5NN8PQGRI5yHxl/tcZ3IKcLxxdoJ/ehto5Abt81IVPqdVs L9m55Y9VOvVKNK7DH2zLD+knLhtBEg6kvOcwVJWJLJtuAcVACdf0x40vK51hzfbAQdMn dceA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=toxnBJPFRtD3QOxALorC41rSKC05NJueDnvaN0Ilxs0=; b=EC7GjBNZ6uUIwwstO/B6/CsLxBxtmQZPpQPBzyWIf5ujbAsWft+lt8+XsiIbQBVGRX NUDW7YhXHrvA0N3tECrnXVmHXa3eJ17ifFOFhsI1SSK9MQO26ukSOxzeh9Sw+cL7csfi GB/ZdS6UtooLONcKld8tJkpX13i3VqJKTrNYwB3373f1QsznM349kMsBhFr4/NmSbNqT w4ScWqABtw3ee/IdrEifWfwUxXsiVXlZiMMh9t4WqXPLqLI3NcQlgy8H+/kU8v4jIt8g 2DhDbGnsqLu7ogIsj19XRyt2ADZUz74p6YeI+LRpSMSM+5Mm2kjcUPay804MBYcJF9py e5Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=M5welZx+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a63bf08000000b004c5936dd6e8si8926076pgf.11.2023.01.16.01.41.16; Mon, 16 Jan 2023 01:41:22 -0800 (PST) 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=@infradead.org header.s=desiato.20200630 header.b=M5welZx+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbjAPIxr (ORCPT + 51 others); Mon, 16 Jan 2023 03:53:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbjAPIxo (ORCPT ); Mon, 16 Jan 2023 03:53:44 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E5014C29 for ; Mon, 16 Jan 2023 00:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=toxnBJPFRtD3QOxALorC41rSKC05NJueDnvaN0Ilxs0=; b=M5welZx+/iKa0n3a6z5zvrAUxa gFdVaBclwpujg4U+Us2xvVw2eQ/Ug5Rsq0bqi5u+SrBQMLF58Dhhk6G122w/YBU123GQXjPwU2juX PdXz9pThtpJ2NKJwwvUPER4oKG2+/Cp4gu+mOp5Hg1fWKJOo46CcLiIBrbWgWcimBPTj1HdbSqmU+ 6b0cxblEP29/3240IJwuoKxFmSqTOqMJgOlaNS4k/Esq2J5EE9n21nxc0t+TirF2ueY/j6aoGfIHf QrW3ybCgcFaslQYYAryEn/8ZRCFnMQI8iDZLKlKSvu1f9nrYTLsRiH9tbtBARuuNKHVYG71t8KsVz Q1pr8Ong==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pHLEk-005XLh-2n; Mon, 16 Jan 2023 08:53:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BE8DC30030F; Mon, 16 Jan 2023 09:53:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9448C20A006E1; Mon, 16 Jan 2023 09:53:08 +0100 (CET) Date: Mon, 16 Jan 2023 09:53:08 +0100 From: Peter Zijlstra To: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Joe Mario , "Rafael J. Wysocki" Subject: Re: [PATCH] sched/idle: Make idle poll dynamic per-cpu Message-ID: References: <20230112162426.217522-1-bristot@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112162426.217522-1-bristot@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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, Jan 12, 2023 at 05:24:26PM +0100, Daniel Bristot de Oliveira wrote: > idle=poll is frequently used on ultra-low-latency systems. Examples of > such systems are high-performance trading and 5G NVRAM. The performance > gain is given by avoiding the idle driver machinery and by keeping the > CPU is always in an active state - avoiding (odd) hardware heuristics that > are out of the control of the OS. > > Currently, idle=poll is an all-or-nothing static option defined at > boot time. The motivation for creating this option dynamic and per-cpu > are two: > > 1) Reduce the power usage/heat by allowing only selected CPUs to > do idle polling; > 2) Allow multi-tenant systems (e.g., Kubernetes) to enable idle > polling only when ultra-low-latency applications are present > on specific CPUs. > > Joe Mario did some experiments with this option enabled, and the results > were significant. For example, by using dynamic idle polling on > selected CPUs, cyclictest performance is optimal (like when using > idle=poll), but cpu power consumption drops from 381 to 233 watts. > > Also, limiting idle=poll to the set of CPUs that benefits from > it allows other CPUs to benefit from frequency boosts. Joe also > shows that the results can be in the order of 80nsec round trip > improvement when system-wide idle=poll was not used. > > The user can enable idle polling with this command: > # echo 1 > /sys/devices/system/cpu/cpu{CPU_ID}/idle_poll > > And disable it via: > # echo 0 > /sys/devices/system/cpu/cpu{CPU_ID}/idle_poll > > By default, all CPUs have idle polling disabled (the current behavior). > A static key avoids the CPU mask check overhead when no idle polling > is enabled. Urgh, can we please make this a cpuidle governor thing or so? So that we don't need to invent new interfaces and such.