Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp344597imb; Fri, 1 Mar 2019 02:08:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzEYZoKaIRwo02rcgrWBGRuKl9waQrFABFocpzf3EYZSmLWdVb82oiuF5Th8T1PukuBpCX5 X-Received: by 2002:a63:5c66:: with SMTP id n38mr3994491pgm.15.1551434917415; Fri, 01 Mar 2019 02:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551434917; cv=none; d=google.com; s=arc-20160816; b=Jzqgo5qqkVRX24SrXSFePVsvMQ0HHquCtYoVCCU3oiPJYtVbSnmCQCxmPUnBszfawF HKoBjy6L5RRzQAU5FRzliE/WuH/Zc1JgPyJvjZFb1yCdo+7Gl6lPwsIG9s/MX9N7ef70 VuqRZLXe1L1qHJ324K/Trt8hkLz/lcybYD8mzDRJdH1j6O/grMTQz2eTexy4Pu+vG5Lo 1p2Vt/39cGj2XmGrhNG4ICXEQk/ymFlH6j82akdP5MdWdZ3HIPtygD1vPtY5Zm0NI3Af lZuG5CFYCN5Ds86ndTPj2MCRRINRzKxAwuRcECubiLval6Id5Gw0HB1pmk9wcstDILjn 95Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=CVkzXAURgF0vppqfid2IWSkU56STvkIxlzLOS99PQIM=; b=WMxOmpC43JuUeE+uO0zsJWKHEsYwRQzctQKD0nSPAf3k58LVkzYs6OM5VUSDjlPeAd 4bAUToL27INMfAIkBDlerrP2RrwXf/oaWbxsl7RK5gMBqwNx+bfqJK11pCLqAAuoyyrE /EmH0uXeE70OD9ZAt/0hRr1MguQZ7R+ajL1MdVFYBuR5Ihd3zyIVncUSeLe3/y08GeqB F3leT6K4XNiV0Chx4B1Kgy8j3WdSs0qkwP1FyH2fif5MFdE1t68DsR7eNtg+1WBW8rz4 /skZf7nOD+mRujhHbNNaeehvgUDJOrWoOWcKeZQe7j6Y8ud82ZfrFdyvrQoLcqlqyYwm 1BLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn10si20206012plb.94.2019.03.01.02.08.22; Fri, 01 Mar 2019 02:08:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732910AbfCAJe6 (ORCPT + 99 others); Fri, 1 Mar 2019 04:34:58 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:33457 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727697AbfCAJe6 (ORCPT ); Fri, 1 Mar 2019 04:34:58 -0500 Received: by mail-oi1-f194.google.com with SMTP id z14so19019831oid.0; Fri, 01 Mar 2019 01:34:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CVkzXAURgF0vppqfid2IWSkU56STvkIxlzLOS99PQIM=; b=hsZCSRbF4iJ157fd/bbpf8YokZn4bHgEyT5358YcQT2vnG5c2oPgIakampPSu0Jm2v +QGDyhDgqSiuQWnMAm/5jFLq8rjRPfwDE1Dx8o15O13Ov5XOS+2LeX+I6QJgEXVqTsYX iReaOlNmrLl2GF09std/dwVr+AuERONKoaUxUYQ/7coCFg1/O4SZBupsAQQFv4YLEMRT ydXVYFyqPN11x7Bf8M/BBWJ8+d6jj38MdtjNo53oHriiM4U7owE0vTX98Ik/K7dz/V7m bK1dtx+qC7wfmjo3qcnsa5h+dztm2vMFkbZSHA3XDbXIpiFYDThzpEcr+tWhQFtnCgfg 0bYg== X-Gm-Message-State: AHQUAuZizch4t+wY1hiKiwt9W8tL8tZmVCuq468/DpPVjkJevCgWijGb XPrnQw1s1PY+IbbZ+hABRQ0C0AtCxL/ZNcfBPjOd7kDa X-Received: by 2002:aca:88b:: with SMTP id 133mr2733715oii.95.1551432897782; Fri, 01 Mar 2019 01:34:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 1 Mar 2019 10:34:46 +0100 Message-ID: Subject: Re: [PATCH 1/2][RFC v2] ACPI: add "processor.broadcast_ppc" hook to broadcast _PPC To: Chen Yu Cc: "Rafael J. Wysocki" , Viresh Kumar , Srinivas Pandruvada , Len Brown , Linux PM , Linux Kernel Mailing List , Yu Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 28, 2019 at 11:18 PM Rafael J. Wysocki wrote: > > On Thu, Feb 28, 2019 at 6:59 PM Chen Yu wrote: > > > > On some problematic platforms, the _PPC notifier is > > only delivered to one CPU, which might cause information > > inconsistent between CPUs within the package. Thus introduce a boot up parameter to broadcast this _PPC notifier onto all > > online CPUs. > > > > Signed-off-by: Chen Yu > > --- > > drivers/acpi/processor_perflib.c | 16 ++++++++++++++-- > > 1 file changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c > > index a303fd0e108c..737dbf5aa7f7 100644 > > --- a/drivers/acpi/processor_perflib.c > > +++ b/drivers/acpi/processor_perflib.c > > @@ -63,6 +63,10 @@ module_param(ignore_ppc, int, 0644); > > MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ > > "limited by BIOS, this should help"); > > > > +static int broadcast_ppc; > > +module_param(broadcast_ppc, int, 0644); > > +MODULE_PARM_DESC(broadcast_ppc, "Broadcast the ppc to all online CPUs"); > > + > > #define PPC_REGISTERED 1 > > #define PPC_IN_USE 2 > > > > @@ -180,8 +184,16 @@ void acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag) > > else > > acpi_processor_ppc_ost(pr->handle, 0); > > } > > - if (ret >= 0) > > - cpufreq_update_policy(pr->id); > > + if (ret >= 0) { > > + if (broadcast_ppc) { > > + int cpu; > > + > > + for_each_possible_cpu(cpu) > > + cpufreq_update_policy(cpu); > > This doesn't actually help AFAICS, because it only causes > acpi_processor_ppc_notifier() to be called for all policies, but > pr->performance_platform_limit is re-computed for the target CPU only > anyway, so the limit will only be applied to that one. > > What happens in the BZ is that invoking cpufreq_update_policy() for > all CPUs causes ->verify() to run on all of them which triggers > update_turbo_state() and cpuinfo.max_freq update, because > global.turbo_disabled has changed. > > That is rather less than straightforward and intel_pstate really > doesn't need any _PPC change notifications to notice that the > MSR_IA32_MISC_ENABLE_TURBO_DISABLE bit has changed as it checks that > bit on every P-state update. Which admittedly may not be necessary if notifications are delivered. I still don't think that updating all policies from acpi_processor_ppc_has_changed() is a good idea, but yes, there is a problem that if MSR_IA32_MISC_ENABLE_TURBO_DISABLE goes from set to unset, all policies need to be updated to update policy->max accordingly, so looking at MSR_IA32_MISC_ENABLE_TURBO_DISABLE from within the driver without triggering a policy update is not sufficient.