Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp121186imj; Wed, 13 Feb 2019 05:45:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IZgy+VF46/l/7gbvY/X4WPs8exCEEdvrzpRTK7hLBPkns3iWULIr6/fZUDAOa+FP2/Slb4Q X-Received: by 2002:a62:c42:: with SMTP id u63mr571842pfi.73.1550065522488; Wed, 13 Feb 2019 05:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550065522; cv=none; d=google.com; s=arc-20160816; b=nJ7B9VrzwfgDlkKZEmtfabCG9nrtlRUBKvTmDRSn12Ni89bXT5EIui7Duf44shGmlD Ebr23U7FykLBnvpmd3nv3GEKykbcVlviYx3dwU1t6cZRVfnJ42Lm2A1kDGLcOSu7c34A TzUToBS51BIO9SQ27t/pIfIrhomhChmDFnsCkjhLLhnDzNw/w07eKLjv+w4z0BRdL+pe 3DeimqRCt5wkpdSMGYEjxuYvKQpa5tryWWTd9r/WkO72aBoFt50b7ZljsB7L+BTYu6oX /RI5tqm38SP1IsLugPBW/36FZmFxHCAEojbE3zObhnbvqWdTreKyOBhzEH+ukFIbgKnD fh3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=QazTkPG2f5TCa7NK92vvv4zjgYJzM5LHjUmv/QghbJw=; b=sXc5e0K3EsPBj99naalCh0W914afWbT4c62NmrBkQmh7VSPUXaNHNtYHGmq+cQQkeY +rFZuxgE+Pch/IFl7Lu/u16un/BYv1T7FhlBmDknt2EbmyUcKGFd/0EWqLzwpKqc3Ni/ cN6lwJHJ6s7PX2LgQgzlomkNbME+3NEBSyVigRUmJxc3ftxnOqlwGvTbbV6S6uoqAE/u xccurqKL3S7h1jKZI5+dlL8mkvzRgoeQ5WY2yXGbj2W+jHwQe48yna3Vr/Knzgxq/rNa Q4Ob7pw1o0JYAsiz2D8cZaL+wybQXW6MxlfBDelk4+cmztnmPStJpNTKL24fJrXDwGmp Ro2w== 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 n20si122095plp.294.2019.02.13.05.45.06; Wed, 13 Feb 2019 05:45:22 -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 S2390008AbfBMKef convert rfc822-to-8bit (ORCPT + 99 others); Wed, 13 Feb 2019 05:34:35 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:42835 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388588AbfBMKef (ORCPT ); Wed, 13 Feb 2019 05:34:35 -0500 Received: by mail-ot1-f66.google.com with SMTP id i5so3046686oto.9; Wed, 13 Feb 2019 02:34:34 -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:content-transfer-encoding; bh=ERtcHpul9DLk1GX7WN1DDikHkgxhGyw8pWlGqwbFDJU=; b=oWXibs5bGf+uYCP1zf7O+vwe8GI46WKzG8dTz5F4z/HVYis3Vuu83MuRfHOgyXQAUo BDL5S7xLeGud9edNJm6njcPv1qsk/nhbVUkAXQfrvxQbMxlTp7yORneWeLvgUmwF9JU3 S72zj6mt9kgJzS3M4IyB/ik0UzGp0xIfYLNoJt8zIKvlWXqUt9HrYfh7j6iDXWdy6H6g cRsRrv3i5ULHbUzWdiKXzMrYmMiP+ndeZIxkqZczJjA+msi6dEYhCRiuXddwPiwK8TQZ yHRp9KkT1csPdXvFD3kb/sGsMDPm34+QUBRB1kHMAPtLc3mWw6wuIbHBc2vh5L7NkGUx l6Mw== X-Gm-Message-State: AHQUAuZ8pdL37wlR4+hMkiWGBU0Pg/eJG45ngswpLTnX3vIrsQDPJJuy 90zjcNJYThbOQ7esOdIRL8TWODJx6PpSs7pgxes= X-Received: by 2002:aca:f4d3:: with SMTP id s202mr735126oih.178.1550054074190; Wed, 13 Feb 2019 02:34:34 -0800 (PST) MIME-Version: 1.0 References: <20190212070839.25981-1-e.velu@criteo.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 13 Feb 2019 11:34:23 +0100 Message-ID: Subject: Re: [PATCH v4] cpufreq: intel_pstate: Reporting reasons why driver prematurely exit To: Erwan Velu Cc: "Rafael J. Wysocki" , Erwan Velu , Srinivas Pandruvada , Len Brown , "Rafael J. Wysocki" , Viresh Kumar , "open list:INTEL PSTATE DRIVER" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 13, 2019 at 10:13 AM Erwan Velu wrote: > > > Le 13/02/2019 à 00:01, Rafael J. Wysocki a écrit : > [...] > > Newline characters are missing in all of your messages. > > oops. Fixing this. > > > "ACPI _PSS not found\n" > > Done. > > > >> return true; > >> } > >> > >> @@ -2484,10 +2485,15 @@ static bool __init intel_pstate_no_acpi_pcch(void) > >> acpi_handle handle; > >> > >> status = acpi_get_handle(NULL, "\\_SB", &handle); > >> - if (ACPI_FAILURE(status)) > >> + if (ACPI_FAILURE(status)) { > >> + pr_debug("Cannot detect ACPI SB"); > > This is very unlikely to happen, I wouldn't bother to print anything here. > > As this is test is made, it means someone considered that case could exist. > > That's why a added a message to catch this case while debugging. > > I do agree that is not very likely. So a single "no PCCH" message for this whole function should be sufficient. > > > >> return true; > >> + } > >> > >> - return !acpi_has_method(handle, "PCCH"); > >> + status = acpi_has_method(handle, "PCCH"); > >> + if (!status) > >> + pr_debug("Cannot detect ACPI PCCH"); > > This message can be printed by the caller and, again, I would prefer > > something like "ACPI PCCH not found". > Fixed too. > > [..] > > "ACPI _PPC not found\n" > fixed. > >> return false; > >> } > >> > >> @@ -2539,8 +2546,10 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void) > >> id = x86_match_cpu(intel_pstate_cpu_oob_ids); > >> if (id) { > >> rdmsrl(MSR_MISC_PWR_MGMT, misc_pwr); > >> - if ( misc_pwr & (1 << 8)) > >> + if (misc_pwr & (1 << 8)) { > >> + pr_debug("MSR_MISC_PWR_MGMT reports enabled HW coordination"); > > IIRC this means that the platform is managing P-states on systems > > without HWP, so I would print something like "P-states managed by the > > platform\n". > > That's what the caller reports. > > I added this additional message because this function added as special > case for this MSR setting. > > if intel_pstate_platform_pwr_mgmt_exists() is true, that's nice to know > why when debugging. I see. > >> return true; > >> + } > >> } > >> > >> idx = acpi_match_platform_list(plat_info); > >> @@ -2606,22 +2615,28 @@ static int __init intel_pstate_init(void) > >> } > >> } else { > >> id = x86_match_cpu(intel_pstate_cpu_ids); > >> - if (!id) > >> + if (!id) { > >> + pr_warn("CPU ID is not in the list of supported devices\n"); > > Why not pr_debug()? > > > > And analogously below? > > I'm coming from a use case where on the same hardware, changing the > kernel changed the performance profile and impacted user's performance. > > I had to debug this case from a running server. > > From the dmesg, one of the difference I saw was about the > missing "Intel P-state driver initializing" message, but nothing else. > > The reason why the driver didn't engaged itself wasn't explicit. And what did turn out to be the problem? Anyway, pr_info() should be sufficient IMO. > As CONFIG_X86_INTEL_PSTATE is set to Y by default, I wasn't enable to > reload it in any way. > > By reading the code, most of the code path and return options doesn't > have a single pr_ call to explain why. > > So I had to rebuild the kernel + my patch to understand which path was > taken and then find the root cause of why the pstate behavior changed. > > I wanted to contribute back my experience here by providing messages to > ease the understanding and potentially debugging of the driver without > recompiling it. > > > So the root of this patch is being able to report the main reasons of > why the driver didn't engaged itself with a pr_warn (could be also a > pr_info). > > All the major and probable "return -ENODEV" calls before pr_info("Intel > P-state driver initializing\n") deserves to be explicit and reachable on > dmesg for the operators. > > I'm operating 30K+ servers and having this kind direct information would > save serious time when debugging this situations. > > If my experience in that area could help other users, I'd be happy. > > I'm positing a v5 with all those changes. Many thanks for your contribution!