Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp913106ybc; Tue, 19 Nov 2019 11:19:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyNosiASaMJrGJE+aE/Wt9+lP2soaSa/erwZiorQ5FtBNBspmMc3R7WKCqtwwwVEyAdgj4o X-Received: by 2002:a17:906:4096:: with SMTP id u22mr36617780ejj.264.1574191152888; Tue, 19 Nov 2019 11:19:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574191152; cv=none; d=google.com; s=arc-20160816; b=cdSxBGradfJNDURA7q0ifoW4qCQkV2JcnIXLCJsmhFITlgS7R5+Cjti3dnovcoW8yh mePU1PgeYYBq3BnbTWm/x/bYONx3EC8GH3zLtKPh5laNrHrRjb/QVhn/qUV5eXy4v1kV iniBLGEMeJACkgORaqZMPI/tduH8yHB9CIm6vYFsMTb3VkQjaBt8a+4MJz2O/YvmXqUQ uBB6zVZ//sS/HoI3A8dqYTyfvoUzjUX89M+bWLmyQTbR+c+xTUHmoI/nQQEFOLu1LXL5 mXEvaxnvVr3HoZDNh9aCufsqY7Klj8TWfyYM9O8QJWNI9kwbT9zTWHQcJAJ+fMBBYizZ vzOA== 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=wNhSIdXIAMhTZZlTq4fvLUCixY9Z52dvDBqLG8iKTeg=; b=ZFHrczKHQ1WEZ8H/BqGcHjNdFSZwlWjbn1NX8Jl4aE5dOWMFlK3jGbBf1OOto6+hGy KWUmh6LUNxYQcH4mah+xnmwQwRPrnLJdjG4o8OSDRQGMM2bcMDhzXYbBsfZ7KYLbmkjo ecXur+dqK4TB3tqHCvzauAwrERGP10qhYWPGH15Pw2qLrontaSlCI424TyODAiR/X2M4 L0E6h6FbQl0FOyAy4fITRNSTRyk1EPtyL7h+dB6TOfSweoaACq/dP4XZsGafSYMCYNRU y+fOTGSyfu08MUWOdrccGa/GMMKNteKjym4rn1lF2YbSM3yhugp3JN+leS4F3BMJEOgT csYA== 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 nq5si14225658ejb.161.2019.11.19.11.18.49; Tue, 19 Nov 2019 11:19:12 -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 S1727450AbfKSTRS (ORCPT + 99 others); Tue, 19 Nov 2019 14:17:18 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:38462 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727036AbfKSTRS (ORCPT ); Tue, 19 Nov 2019 14:17:18 -0500 Received: by mail-oi1-f193.google.com with SMTP id a14so20050278oid.5; Tue, 19 Nov 2019 11:17:17 -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=wNhSIdXIAMhTZZlTq4fvLUCixY9Z52dvDBqLG8iKTeg=; b=RwYmRCTgVEBKrMJlWvkpWxd/5naacajGqd7cDvNQfe10wT0oEdntJWDUuS7cNHwA5Y Pc3sIynZs9P6WuCaA8VkzLAHA2sa1oNFvHf2M5M8D6iut9pi3R9NAI1LvL66zrlIO1qO r+Y1CDonyZnv8kRpjDVwnZPSNnOuK6VTTqSsqR0x8mzjTFqN/cumHEzq7RzmDWKNGrwf N4lh6JXh0fe8oAEZvyTWO/yFE7AJBkGE7eIrAOmFm0fskx5IVuwuRvyGvm3kow5wG0PN u5N99lSFkWWN6wd9CDh+0STVDUYMwf5wB9il+TNbJmCXb9tz6jf5EvzRS7easWy8HQV/ iBKg== X-Gm-Message-State: APjAAAUf/z5oP2KnQc/BzZfo1tozVfdtdkwkr68hjlKZBS15ZLlP/Z4S dFLN0Fz+ikGeTUG9oJzHqiEVqWz89/B0B6BAl7o= X-Received: by 2002:aca:1101:: with SMTP id 1mr5643630oir.103.1574191036787; Tue, 19 Nov 2019 11:17:16 -0800 (PST) MIME-Version: 1.0 References: <2811202.iOFZ6YHztY@kreacher> <4551555.oysnf1Sd0E@kreacher> <000001d59d61$eb4e6670$c1eb3350$@net> <000401d59ee6$959e3da0$c0dab8e0$@net> In-Reply-To: <000401d59ee6$959e3da0$c0dab8e0$@net> From: "Rafael J. Wysocki" Date: Tue, 19 Nov 2019 20:17:05 +0100 Message-ID: Subject: Re: [RFT][PATCH 1/3] PM: QoS: Introduce frequency QoS To: Doug Smythies Cc: "Rafael J. Wysocki" , Linux PM , Linux ACPI , LKML , Viresh Kumar , Sudeep Holla , Dmitry Osipenko 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 Tue, Nov 19, 2019 at 3:35 PM Doug Smythies wrote: > > On 2019.11.17 08:13 Doug Smythies wrote: > > On 2019.11.16 23:35 Doug Smythies wrote: > > >> Hi Rafael, > >> > >> Not sure, but I think it is this one that > >> causes complaining when I try to set the > >> intel_pstate driver to passive mode. > >> I started from active mode, powersave governor, > >> no HWP. > >> > >> Kernel: 5.4-rc7 > >> > >> I did not go back and try previous 5.4 RCs. > > After looking at the git tags for this patch, > I tried kernel 5.4-rc2, which was the closest > Kernel I had to before the patch set was added. > It worked fine, as expected. > > >> I did try kernel 5.3-rc8, because I already had > >> it installed, and it worked fine. > >> > >> I use a script (for years), run as sudo: > >> > >> doug@s15:~/temp$ cat set_cpu_passive > >> #! /bin/bash > >> cat /sys/devices/system/cpu/intel_pstate/status > >> echo passive > /sys/devices/system/cpu/intel_pstate/status > >> cat /sys/devices/system/cpu/intel_pstate/status > >> > >> And I get this (very small excerpt): > >> > >> freq_qos_add_request() called for active request > >> WARNING: CPU: 1 PID: 2758 at kernel/power/qos.c:763 freq_qos_add_request+0x4c/0xa0 > >> CPU: 1 PID: 2758 Comm: set_cpu_passive Not tainted 5.4.0-rc7-stock #727 > >> Failed to add freq constraint for CPU0 (-22) > >> > >> freq_qos_add_request() called for active request > >> WARNING: CPU: 1 PID: 2758 at kernel/power/qos.c:763 freq_qos_add_request+0x4c/0xa0 > >> CPU: 1 PID: 2758 Comm: set_cpu_passive Tainted: G W 5.4.0-rc7-stock #727 > >> Failed to add freq constraint for CPU1 (-22) > > Updated summary of previous emails: > This patch or patch set breaks the after boot > ability to change CPU frequency scaling drivers. > > Using a workaround of booting with > "intel_pstate=passive" seems to prevent the errors. > > Changing between the intel_pstate and intel_cpufreq drivers > (i.e. between active and passive modes) > after boot, either way, causes the errors. i.e. > > Failed to add freq constraint for CPU7 (-22) > (2 per CPU per attempt) These messages come from acpi_processor_ppc_init() and acpi_thermal_cpufreq_init(), AFAICS, which are invoked by acpi_processor_notifier() and that is invoked by the blocking_notifier_call_chain() in cpufreq_online() which tirggers for new policies after adding the max freq QoS request to policy->constraints. The requests added by them should be removed by acpi_processor_ppc_exit() and acpi_thermal_cpufreq_exit(), respectively, invoked by the blocking_notifier_call_chain() in cpufreq_policy_free(), but it looks like that doesn't happen. However, I now also see that freq_qos_remove_request() doesn't clear the qos field in req which is should do, so freq_qos_add_request() will complain and fail if the object pointed to by req is passed to it again. I'll send a patch to test for this later today.