Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp65247lqb; Tue, 4 Jun 2024 05:23:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUR95S9EPCpuUlmmTLct09tikZAT47mDMHItY35WB1OWb0wQERrehYPn9dZq6ljNbu3ulHNOiLX5l4kDHFByg6sLvZsMJPT3iTb7iAIjw== X-Google-Smtp-Source: AGHT+IHnLS44OUrHlz5LUasQ9A9nSS00cAPG/UPllsGnb8NENFLjy9PrODdFOaItHTrkuj3RX7lq X-Received: by 2002:a05:6602:13cf:b0:7de:dbcf:b67f with SMTP id ca18e2360f4ac-7eafff5f5demr1110395039f.21.1717503833806; Tue, 04 Jun 2024 05:23:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717503833; cv=pass; d=google.com; s=arc-20160816; b=mEtxlW5WSshpNPAuUJQ59q9khPMd+LASW9VKK1ehNpiBQxIqD27+m0bu49gC8v5eoi PYM23iEGxR7YlBDX+sWW+g+X6vtBy8EochtRGcofIQtgCV+yrEsSdENoWXamGzuT4Olz 2VWQd2ocO3eJE0RE1pAFnSOHL4cJRy8G+P00L8FBBNXKCzWrC5xWaXorwUjlvRP7eY3c 7AgnbotL6IBs70PWnYDH8okjVl2gL2yi04WvmX7Alyvf6tkZ1sGRBE4NMxdzZ2Uv0nmh DFK34PWAvb5++lRg+4Hn0oeAb35T3ssP/LCVu51SYLbwnNmyrT6XCeSXwE1VcY5belWE 6OPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nDT2bdM/4/u6WBFZYLUGZAG2i8Sme/HZ9vIEUuTgqF8=; fh=b8NJv5QzECf3klzf9cNnO1DanYRbT6K9Nlz8PhfM1fU=; b=nBDz28A15uDu4heEwLHNFT6iR8BS73ze2O7XQbQn1h84ACSCTJBC6dWKaEUsvYbUb5 uQIVVOXC1Tx0cazdsJI875zjtcvzXTGQ46ONfKw6Kg0umriv+fndN6BJEXsKow/NF5DU n8KlfqIdTxVRvhDCZ/U5GNyA49mHbRcR9ZpP9iJ+1GOEaAemJIfentBXfhufoM0QgNgE dwDwvpqP8vJPu+k8sKZ1t/htETnQYuWIUNJcMu+M8VQs7+ZcDU0u9uWHPjGlYXamD2iA cw37m+8oRZWcsuuAva+Y1zwrZupyzx4J7/CjcnAZiI+R/4d7hwRtQLmdnC2G2uXYHD44 9Xcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=qtRuht1T; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-200580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200580-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b40c458si8219496a12.494.2024.06.04.05.23.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=qtRuht1T; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-200580-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200580-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 27376B21AD1 for ; Tue, 4 Jun 2024 12:23:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6593B146000; Tue, 4 Jun 2024 12:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="qtRuht1T" Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 177B3145FE4 for ; Tue, 4 Jun 2024 12:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717503823; cv=none; b=e/ihSKFwNvD3KJlxXCEj5uhzGGi5Vfwo4ySUbJm5PWMBuEAWg6SiysC6bT53QaYli7E5GR2RtU+nk0A8ywZVlv0u9ud1wDWSDTWo2+YSLqjVoYdDSGG8/hqI/c8INXmt+yDE2Ppv52NHHVeeg2qCrd1N1i7PM96NzyZEEY/lDQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717503823; c=relaxed/simple; bh=pJ8H3OVU1c6IKHhJWjKqHXekB9Q4BtWpxv/w8o99SpM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=abXyPcTFhlD2p3EqgdD3ZmiMk3T3nqYxLCsuBuFOC3PPR1ZUWXRc5qiuko+r/q9hkX/vQK4h5RXRdEZfRK12xf1dtNXfevm8rMuqo6+NLifbGBlitBHxqMZpA/u130p1NCV7DrzUkwzlA4vkhkDJBpi6D7JT8vp4lfTDFf6vums= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=qtRuht1T; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2eaae2a6dc1so39301951fa.0 for ; Tue, 04 Jun 2024 05:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1717503819; x=1718108619; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nDT2bdM/4/u6WBFZYLUGZAG2i8Sme/HZ9vIEUuTgqF8=; b=qtRuht1Txt9xVm50fip4fbI8Us0Dw4z9pM4tdvKZSezzH4MLg+KHHP/4yMv9a36Nd5 VoxaDSLzDN5ZFBszS5iQKeGdkTZH94KlE+R5QEOq1ZilJNIrhxwl4a6PINj6VUsxfsQM qqGgeds8YkfBgX7ryHxx44sLPGnqun9EexL4qZlYJrl5Ov3eNMw2CsyIgujI6XKqRUe1 7oVWr9gaEwS7kU3u62ZzxwNkpxBtyCJrkeHBtBhzFKyIk1JqGhQCMriWqAsb/N/Lk+rr Wxcxvh+tmNNQVN7UHgI6ZVCa411zcvMMmoVJlkcku7QurKlinysdwkCjj5ItenER9+i4 oeMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717503819; x=1718108619; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nDT2bdM/4/u6WBFZYLUGZAG2i8Sme/HZ9vIEUuTgqF8=; b=jJynFO+R4kulroBV5pxeQWm0t8DgrZVQtjU1TS2NKDJHC8p/oFy7/euxhh8QVc6j8F lOOKQYFAjMgrwb3LKh9zChWJbKHeiOYc+pp6LqMNaobL4Qi3eDRoeWLvbgVFz7MHkpAx Zhfx+o4CmTECIu3COGYl7VgP6gnbIRBHtLViPtz4qDbzJB2RZ7iSGWDfitar2avwu0Bg dFB+v44+CtAnXG92vCT30g7qwONhR/Tdkg3SdqGatxkPfjHcWNrm6gbdJXIdhSw9huFs fDCuIz+QI2hKQ4Nz++0GeP9Czw7IKo1A8Kovpf8myihCr7tzis4b0I8Raaq6eE2va1l2 BfvQ== X-Gm-Message-State: AOJu0YzXqvjS5wA4Rbx/o/3V/UoseBClJKpU5UqzllHhOZ4zWy60e+p8 u39vIo75qm9F77woaHm1AZuedLAW0FQxJz8K1xzn5uDYUuiWP2fMttTBe7+oaL1ItalXVmzsgnN + X-Received: by 2002:a2e:978b:0:b0:2ea:7e9c:eb8f with SMTP id 38308e7fff4ca-2ea95153dc7mr97900971fa.24.1717503818985; Tue, 04 Jun 2024 05:23:38 -0700 (PDT) Received: from airbuntu ([87.127.96.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4213860126fsm104473445e9.40.2024.06.04.05.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:23:38 -0700 (PDT) Date: Tue, 4 Jun 2024 13:23:37 +0100 From: Qais Yousef To: Phil Auld Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Tony Luck Subject: Re: [PATCH] sched,x86: export percpu arch_freq_scale Message-ID: <20240604122337.jknxekohcu23v7dz@airbuntu> References: <20240530181548.2039216-1-pauld@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240530181548.2039216-1-pauld@redhat.com> On 05/30/24 14:15, Phil Auld wrote: > Commit 7bc263840bc3 ("sched/topology: Consolidate and clean up > access to a CPU's max compute capacity") removed rq->cpu_capacity_orig > in favor of using arch_scale_freq_capacity() calls. Export the > underlying percpu symbol on x86 so that external trace point helper > modules can be made to work again. To expand. The problem here is that arch_scale_cpu/freq_capacity() are defined in headers, but they rely on per cpu variables that are not exported for x86, but are exported for arm (and riscv at least) in drivers/base/arch_topology.c One user is sched_tp to help create trace events to track when capacity changes. Not critical user, but this brings x86 inline with the rest of the code. > > Signed-off-by: Phil Auld > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: x86@kernel.org > Cc: Tony Luck > Cc: Qais Yousef > --- > arch/x86/kernel/cpu/aperfmperf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmperf.c > index f9a8c7b7943f..b3fa61d45352 100644 > --- a/arch/x86/kernel/cpu/aperfmperf.c > +++ b/arch/x86/kernel/cpu/aperfmperf.c > @@ -345,6 +345,7 @@ static DECLARE_WORK(disable_freq_invariance_work, > disable_freq_invariance_workfn); > > DEFINE_PER_CPU(unsigned long, arch_freq_scale) = SCHED_CAPACITY_SCALE; > +EXPORT_PER_CPU_SYMBOL_GPL(arch_freq_scale); x86 uses the generic arch_scale_cpu_capacity() in sched/topology.h, so this should make arch_scale_freq_capacity() 'work' for x86 too. Reviewed-by: Qais Yousef > > static void scale_freq_tick(u64 acnt, u64 mcnt) > { > -- > 2.43.0 >