Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3105200imb; Tue, 5 Mar 2019 00:41:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxQtM+LwEURsEoAU0hc1lN0r3/SUCR+J0VLtR1dpvSfGnbnaHShttkGXUPULfvoVEv0xA50 X-Received: by 2002:a62:4117:: with SMTP id o23mr752894pfa.248.1551775311329; Tue, 05 Mar 2019 00:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551775311; cv=none; d=google.com; s=arc-20160816; b=FnQNH7PNLbBag0fqSWm4PQtkRueA/5LnwmBlOS8+lzKc7T8UNdqFAlaitXAf8YYkYQ +iHSo3pkOylVXppgArTDyq0afIIUhuO/WQ8BGVAr6/ZgF4fsNmnH4KLb+eXYB6YtMvCC G9M9FUnmN0NpGy3LDWCc058MUXFkLFYb9Xso68jMSqBKD0TijJRFgy+pUAbFuipUdhAb NCsJNDb62Bqf+GVW9VZYQUCFQuArUlK66WA71+ShIEW9NSYka9LXlfSw34tphpHR9B89 eCXahCJl8ODetqTGBT8ky0pxRCO/wWNjBbVUrFCadVu/ZWVAuGums7mMy93x4gaeeOxS FOyQ== 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=lf7r44Um24R4GdB5QmaPg6eyhK7t+VzxZEiX0Xzj6Kc=; b=d818vTD8bRk0qRg2Yd7UJ+9bv2cJ/dnk6upr+j6AqVynOdr9wFrF3kifBnbgowJiZp a3DgYoUe7tD05HBxeJoUn95WjtuwlpDLHwWsb+XzSZITQjl7RGL9XsPHZgSXX62y+YSY gUzS3LTQZdCtnH0B6tmSlAdPrFUuVfHoT50XROV4u/V8h9riUC6HRhkTrLrIklHotiYk bfmnlSbFMy+MYE6IQp+mQHEGTFsHEIhCZZMqWs86RlCQ8YUQ0gFGuhcDWVmiwWK54qOJ FuCv0lK2UGnP5HgODlaMW5XXHkteuvL/YYEDs80Tdfmq3cE2Q8DcBhL2E5vuZVJLwcQG gm1w== 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 u22si7570669plq.145.2019.03.05.00.41.35; Tue, 05 Mar 2019 00:41:51 -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 S1727375AbfCEIk6 (ORCPT + 99 others); Tue, 5 Mar 2019 03:40:58 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:36691 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbfCEIk6 (ORCPT ); Tue, 5 Mar 2019 03:40:58 -0500 Received: by mail-ot1-f65.google.com with SMTP id v62so6762650otb.3; Tue, 05 Mar 2019 00:40:57 -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=lf7r44Um24R4GdB5QmaPg6eyhK7t+VzxZEiX0Xzj6Kc=; b=BRHZuojZSpJPGVHDOhPjyQoCVXEu76coJYsWzBPLAtyW0rUZhfKGAbrBR+b/3v59lb BLB1AS4vAEmoooGu/ObDuVJL1M0HBwHFL2V5elRAcr3Bj5OrONMvQt/A0ZOIaAcurp9A 047J8AGvdxoFhDFUU4ouScugBlILYmnJmS4C2xRwxB/awYeix/h4szeAvkCdgDEMIMAn LahJmTcMAKKxhzN/dACngn4Zi2S7LGqEX5P96klTmIxmpwLPCjFHlIr33QN4I2eQUlFY 5uEF46AALvqW2HCRlCWxnYF7EW6EUB2kx0SjZWjdj1Iv4fe79VqKdOOskjrpB81W+gqy dLgg== X-Gm-Message-State: APjAAAVtaTcl0UxOUhdsK8BQTmerJTZjoOzso0+v3h/wozamgIK7MBYV o8Mc6wqDxGbyptgqVCfElpy/DWax2oXAqyLCsmkPGw== X-Received: by 2002:a9d:7cd3:: with SMTP id r19mr264386otn.139.1551775256529; Tue, 05 Mar 2019 00:40:56 -0800 (PST) MIME-Version: 1.0 References: <9956076.F4luUDm1Dq@aspire.rjw.lan> <47ce61b9df7701e047ef6f59afd54c854db8a538.camel@linux.intel.com> <9099672e17ea9fc7711b34e92ce5a016afb43a0c.camel@linux.intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 5 Mar 2019 09:40:45 +0100 Message-ID: Subject: Re: [RFT][PATCH 0/2] cpufreq: intel_pstate: Handle _PPC updates on global turbo disable/enable To: Srinivas Pandruvada Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM , LKML , Viresh Kumar , Chen Yu , Gabriele Mazzotta 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, Mar 5, 2019 at 12:04 AM Srinivas Pandruvada wrote: > > On Mon, 2019-03-04 at 22:57 +0100, Rafael J. Wysocki wrote: > > On Mon, Mar 4, 2019 at 7:06 PM Srinivas Pandruvada > > wrote: > > > > > > [...] > > > > > There are other methods like PL1 budget limit for such cases. > > > > > FW > > > > > can > > > > > just change the config TDP level. > > > > > > > > OK, but that would be done without notification I suppose? > > > > > > There is a notification via processor PCI device (B0D4). This is > > > passed > > > to user space to change the power limits. The new element is called > > > PPCC and it is exposed via sysfs. > > > > What do you mean by "new element" and how exactly is it exposed? > > This is part of DPTF processor ACPI object (INT3401 or B0D4). They are > exposed in sysfs > E.g, /sys/bus/platform/devices/INT3401:00/power_limits/ > > There is a thermal uevent sent when they change. Both dptf daemon and > thermald listen and use to set rapl power-constraints including step > sizes for control. Someone can write a udev rule to do the same. But the measure at hand here is a power one, not a thermal one AFAICS. > > > Disabling turbo is not very interesting as there can be more turbo > > > than > > > non turbo. So you loose lots of performance. So instead you can > > > control > > > power in turbo region to give you more control. _PPC is even less > > > interesting as you can't control uncore power. > > > > I guess that designers should know about that. The kernel is on the > > receiving end here. :-) > > I think they know. Hence you don't see this issue of enable/disable of > turbo by firmware quite often. This laptop here I guess released in > beginning of 2014 with Haswell. In this particular case, the battery is probably to weak to sustain the currents associated with using high turbo P-states, so turbo needs to be disabled altogether in order to avoid using turbo P-states at all. I guess this still would be the case on a contemporary system with a sufficiently small battery. > > > > > [...] > > > > > I guess that you are talking about intel_pstate_update_max_freq() > > which acquires policy->rwsem. If so, what exactly is the problem > > with > > it? > I was suggesting to use an API/define in cpufreq.h which does operation > on policy->rwsem for better abstraction. This is the first time it was > used outside core cpufreq.c. As more places it will be used in future, > common function will help debug, if in some path there is a bug in > aquire/release of semaphore. But you can ignore this. Well, I guess I could introduce something like cpufreq_cpu_acquire/release() that will lock/unlock policy->rwsem in addition to getting the policy. That sequence is used in a couple of places already.