From patchwork Mon Apr 8 08:46:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 10889019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C1C21669 for ; Mon, 8 Apr 2019 08:46:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61AAB27CAF for ; Mon, 8 Apr 2019 08:46:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5585B2863E; Mon, 8 Apr 2019 08:46:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED61027CAF for ; Mon, 8 Apr 2019 08:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbfDHIqt (ORCPT ); Mon, 8 Apr 2019 04:46:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:54602 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726465AbfDHIqs (ORCPT ); Mon, 8 Apr 2019 04:46:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1BD76B039; Mon, 8 Apr 2019 08:46:47 +0000 (UTC) From: Thomas Renninger To: Rafael Wysocki Cc: linux-pm@vger.kernel.org Subject: [PATCH] x86: Do not override performance EPB MSR value on servers Date: Mon, 08 Apr 2019 10:46:46 +0200 Message-ID: <36183132.7cOCK0nhyl@house> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is about this kernel message showing up on quite a lot servers: [ 0.072652] ENERGY_PERF_BIAS: Set to 'normal', was 'performance' [ 0.076003] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8) With this patch the EPB value is not overridden anymore on systems which expose themselves as appliance or enterprise server via ACPI perferred profile variable. Signed-off-by: trenn@suse.de Index: perf_bias_acpi_server_only/arch/x86/kernel/cpu/intel_epb.c =================================================================== --- perf_bias_acpi_server_only.orig/arch/x86/kernel/cpu/intel_epb.c 2019-04-05 14:43:04.280222577 +0200 +++ perf_bias_acpi_server_only/arch/x86/kernel/cpu/intel_epb.c 2019-04-08 10:01:26.029278425 +0200 @@ -19,6 +19,8 @@ #include #include +#include + /** * DOC: overview * @@ -89,7 +91,10 @@ static void intel_epb_restore(void) * ('normal'). */ val = epb & EPB_MASK; - if (val == ENERGY_PERF_BIAS_PERFORMANCE) { + if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER || + acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER) { + /* Keep performance setting on servers */ + } else if (val == ENERGY_PERF_BIAS_PERFORMANCE) { val = ENERGY_PERF_BIAS_NORMAL; pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n"); }