Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp10915imb; Thu, 28 Feb 2019 14:21:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxoOVDpfLFI9WDs3i4kFJ5H4pwAxiJL+CrwOF1XklGPz3LtWd2vPAh0UH36l4N3ZwjtEz8b X-Received: by 2002:a17:902:b591:: with SMTP id a17mr1855904pls.228.1551392478994; Thu, 28 Feb 2019 14:21:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551392478; cv=none; d=google.com; s=arc-20160816; b=AG3qfDGU7r4JqYH0ctXObqYQlLBkawZOLVdygtPVYXxiBXZc80Hu7b3bBMw1sgDRI4 SqieRwrqfBxDk90qAr8AyAzdWjFuUB0VVgz/Ucxv5ZLy9jRaQibbKS9OFqZ0XOlAdm2q TmtAY4Ts/zQ59g/+kub5cESrwF1MivnOphOdxapikyIVk3hXSRWx6yx+eh3+dnu55eq0 qQkYiomXYoFAGE41DMseVfUX7IFgHVcpmogz54nLphyqmIDJyceTJ3eelWBrjAgNDtqa XoCA3HcIjmuPPLIyrg09105vRA7FpgmnJDWDyTNOaW97Q02Sjk2gc0JwSV5tgVMB4wAe PoWA== 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=Ji3mmE4+UtF9krUdy/zdGVH41oTqTHXFLEm6pMEOivc=; b=JVL+iV7q1X4bUbUkckK1LdGgpzrg5G9RrKWtFBGKVmdYWZYThUW/YFun4+TVDz5q9l 5eqdNguJ9ue+MtvvWbTY9Wfwmiswp9wWdJimLb+2cS61GVF9CX10p16eNCFhaseiWR6A VZMmqs97T7mxUJooF+y/aHy4x7PNLpqnnCp6+cmxrH502eBmb3dVX1Jku2Oxpo/YhvL2 UYM9VNmjKABjMY3Kd4wDbh7hHIU04jV8wnpe1CZDcv1PuNWdMOj5Bi42DrpCdb/yPrkL LhTCXMxhX3hXkOGtE2VgC7C9mKgASFLXgiVWZqskuMZZgv0Aac414GLtt29W5O1dpJKs xK1A== 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 13si18344429pgm.311.2019.02.28.14.20.56; Thu, 28 Feb 2019 14:21:18 -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 S1729193AbfB1WSw (ORCPT + 99 others); Thu, 28 Feb 2019 17:18:52 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:34543 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfB1WSw (ORCPT ); Thu, 28 Feb 2019 17:18:52 -0500 Received: by mail-ot1-f68.google.com with SMTP id 98so19255617oty.1; Thu, 28 Feb 2019 14:18:51 -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=Ji3mmE4+UtF9krUdy/zdGVH41oTqTHXFLEm6pMEOivc=; b=NyzqxHIG0lu6wDBA8OtZVudS/dlmkRuU5QQIbdhR5KeYAFhDSMJzwdmBrgRq5e7rMV AsjwHO4irKjl0hBgLGRnm50X2GAEyLvKXFdJN7vkeSCFmRJ30JelEHwG0yvTwaxedUKF tIlA6kNihow7G8o6cXEEeqB7J3Mizt/cw1P7iaC2UqbIncUH/Y4B8XUbvSVttuAwPFxe bzZkam4erOyOPwgIX6fEKd07QE/LJt9UzKJnlZrxvov9ziovlopBDVJEzyR1kU/c8qZa QzX2KNHALXhrdas10OUklwU/n6X80sh/m/aUni6/Mzh6PlU6gDtayvOsTU10l8sBTPpM OzWg== X-Gm-Message-State: APjAAAXUeq09VLdQ+dXQ4rpX2wbLI1CgTitLTfRynBuyHuc7U1JQp65i zTkHqDHvfh2vQStXNMEDj2BXhFXTbgdn8ynzEoI= X-Received: by 2002:a9d:7547:: with SMTP id b7mr1285722otl.244.1551392331152; Thu, 28 Feb 2019 14:18:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 28 Feb 2019 23:18:39 +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 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. So no, we are not going to do this to fix the particular issue at hand. > + } else { > + cpufreq_update_policy(pr->id); > + } > + } > } > > int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) > -- > 2.17.1 >