Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp81772pxb; Thu, 21 Apr 2022 17:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEw8bmpHDKH1vpMZ7fb5VkWmT1Glbe1t1tJxL3VEWh0zDcAn0ulL+Rs6wgCxwQi7lWDOed X-Received: by 2002:a05:6402:4493:b0:41d:83ca:35d6 with SMTP id er19-20020a056402449300b0041d83ca35d6mr2159122edb.89.1650587945813; Thu, 21 Apr 2022 17:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650587945; cv=none; d=google.com; s=arc-20160816; b=R9uTDQ1IEfnBBNCJ27Vaz9v3I4VNDgQmoYnkU3YEABaB8j4hHMDLCVFR3av7XVeq/p BHrAhQ6IUNa2ouGj0h6Fzj2qvNccR940AFPQYovWCH16b+Zvasdl8XMxXLKI+zpRnsjs n3J3V+9M7k6G5V8/Z73XUBI6QsrqmPDk9+vE1+/PwAQ5rJQK19lpAlgtYLW9UIR6ws1H 76gui7iXYkRU+wOT19ahzP5S5v+OmOECjpP3Yb3+oJE6gBy8rdkY0QNGqvP4v+0qxwh4 P6rMxQxmR9tOIYWTP4lvxW1oCcpPp3chfQndNI9nHkxxEF11F6IG0h4eFLMWN6blZNt+ wHrA== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mqWZCJQbJArwAWjk9Albu1VxZM0j7kuByZgZ50dsGDI=; b=k4KWI5gsJm8DfR4zGBXJrjnFw8Ynt5YhejlGwyhaB8kkZ8jaDlKmT0PZVkUADAzS3i YHPp0okb6elG7Qu7vju6l8N+5iIqXGIm/xOLv7Ym+qpkietPBVFGphT5s5m8ijBqzMpB C8iLODvSyeRJSqwSUTTR49HlzJur52qazQQIJ1dU+q7RpMGNYAiGGTayCbmu0XglG4in QJXsGuDr7m/EJTgwafTaFLmFxwGe7lTv1b57I3qXb5KJL+zObyKZqfIK3gCCEPc1v39v owWUEgISci8WVn88zuJh3H5nZRlgS3cvZs4E+vUG+LUhx6wzQ/dVAk5qBl/Q+w15CP/a p23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NKWXwr1i; 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 x23-20020a1709064a9700b006e8991e7850si5485033eju.538.2022.04.21.17.38.42; Thu, 21 Apr 2022 17:39:05 -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=@kernel.org header.s=k20201202 header.b=NKWXwr1i; 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 S1358108AbiDSV7n (ORCPT + 99 others); Tue, 19 Apr 2022 17:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235596AbiDSV7m (ORCPT ); Tue, 19 Apr 2022 17:59:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C614640A26; Tue, 19 Apr 2022 14:56:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01568617A3; Tue, 19 Apr 2022 21:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 595E2C385A5; Tue, 19 Apr 2022 21:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650405417; bh=vK+u19Vo4pPWHW4AOOoegJ23VjuTI5AZJt/iy5wjXnA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=NKWXwr1iZiOxaeAeXmhNeNUD8aHdbbrzkY7acDWF9Xn+s950ZoWL4sWSq+Ufd8gHN RPnILUgBdL8RXe9MGCNp6L+jHB2u2j0Cg2dmDRBleDX1ULsxLABc1WCFrDGllZxsTh WDqnSO3sYDkXRsEPq+nK47JMXRXyoagNtpnvmXRQ0p/OQKLT/UrMaJY8C74vymugrV zPWT5jf2O1CFNoti3s4d+U6hxrVG/FrSmP59t/GaEZH1tOcvypQ/lL20uz0PeGZ33Q eBqhyM+oq+Ngv1uXsLW/qJOxkTXTpuLc9S7FUBL9C8RDkFguzbT/V8IF+QrEkn1w9I ZkgsUPBtZmKPA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EAB3D5C031F; Tue, 19 Apr 2022 14:56:56 -0700 (PDT) Date: Tue, 19 Apr 2022 14:56:56 -0700 From: "Paul E. McKenney" To: Thomas Gleixner Cc: LKML , x86@kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Eric Dumazet Subject: Re: [patch 00/10] x86/cpu: Consolidate APERF/MPERF code Message-ID: <20220419215656.GT4285@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220415133356.179706384@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415133356.179706384@linutronix.de> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Apr 15, 2022 at 09:19:48PM +0200, Thomas Gleixner wrote: > APERF/MPERF is utilized in two ways: > > 1) Ad hoc readout of CPU frequency which requires IPIs > > 2) Frequency scale calculation for frequency invariant scheduling which > reads APERF/MPERF on every tick. > > These are completely independent code parts. Eric observed long latencies > when reading /proc/cpuinfo which reads out CPU frequency via #1 and > proposed to replace the per CPU single IPI with a broadcast IPI. > > While this makes the latency smaller, it is not necessary at all because #2 > samples APERF/MPERF periodically, except on idle or isolated NOHZ full CPUs > which are excluded from IPI already. > > It could be argued that not all APERF/MPERF capable systems have the > required BIOS information to enable frequency invariance support, but in > practice most of them do. So the APERF/MPERF sampling can be made > unconditional and just the frequency scale calculation for the scheduler > excluded. > > The following series consolidates that. Acked-by: Paul E. McKenney > Thanks, > > tglx > --- > arch/x86/include/asm/cpu.h | 2 > arch/x86/include/asm/topology.h | 17 - > arch/x86/kernel/acpi/cppc.c | 28 -- > arch/x86/kernel/cpu/aperfmperf.c | 474 +++++++++++++++++++++++++++++++-------- > arch/x86/kernel/cpu/proc.c | 2 > arch/x86/kernel/smpboot.c | 358 ----------------------------- > fs/proc/cpuinfo.c | 6 > include/linux/cpufreq.h | 1 > 8 files changed, 405 insertions(+), 483 deletions(-) > >