Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4600185yba; Wed, 17 Apr 2019 15:12:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdyqQOVH9keJj81GeNcPXOvuGqZ1GwnE0bMT59pLbNxi3FwweS42usRma9KuxiJaJiWiBM X-Received: by 2002:a63:c40c:: with SMTP id h12mr73432105pgd.39.1555539146225; Wed, 17 Apr 2019 15:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555539146; cv=none; d=google.com; s=arc-20160816; b=FOxXW7s0ZRQUqxYqFvCZZawE0WllvyFZupHbeOvjnhtOGwR7Zr3phEZugwVeXrD9Sm z18baepEz8ZRN0mu9BCunX+pGU3W4nS5SGmv06/xVhdYVxRnfUhsgaCae5XthH0hK/rV mIuCZPH7dSZZVIRGQalPgeFKT5k9d1itdIccXNwSw+bCibAC3975fZSBICi/LsfsAhjz K7qkeDdoZqzw6N7OaRHuNbNrbqjXzqqyzRfdP9AHMdX9KUxaoWgIZwh8L8GuDrxEIVjl 1tftMOkXCzllgNFjLgXUW80zcvY8t1GnAAZI9q7osG4D3bNzy6ASSA5ICew5K8pfcdxA 9qJA== 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=i/SMcLR60pTb8GHWCFJb8vDfzN0yXO1auw51WJ143aM=; b=hp4n+HrPz91ai2CMU1G9R2fnavQwaIIIXpEKUvUdeSbHrFE5FwIE59tLuBn09simpw AHc8hr7o5ntIPDZfsn1XetWm1Is6sSqx0j4LBYUNjAY2ESlFxgs3/smIIKs3VQ670bOW RH73ytNIJIQJyPo0tlm/Y+IpXVW1fbBTt/X6Yjy0QGkf0jdtXZ3cKV6xN/UCdssNWet2 WcESIx2YOYbOYytg5jm/5/26tVMJqXGQfDGV5jecNxWN5WyQ8UucHk1GjB03QzVeHfJY MugZ7w1oO6oi4pNB9dVWxdeUdO1najnEIVFluO6yJg/4+sMj77j7jnePeqGxtihqc41j /rRQ== 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 b40si187277pla.277.2019.04.17.15.12.10; Wed, 17 Apr 2019 15:12:26 -0700 (PDT) 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 S2387488AbfDQWLN (ORCPT + 99 others); Wed, 17 Apr 2019 18:11:13 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43015 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728237AbfDQWLN (ORCPT ); Wed, 17 Apr 2019 18:11:13 -0400 Received: by mail-ot1-f66.google.com with SMTP id u15so2076otq.10; Wed, 17 Apr 2019 15:11:12 -0700 (PDT) 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=i/SMcLR60pTb8GHWCFJb8vDfzN0yXO1auw51WJ143aM=; b=MzLs64D21/i6dz4Wcp9rEEjaDTWXhDGx3GD3okENLrwdQzsmjRNz1BXr2K2j/mx1IE OqjZF/xjclhhALOp5XPeTZbuyO3zAy22O/dQgadXr1Ydg9Xtdc5lDGt/qiGvEgcX1E5Y INO1XLOWrskDaCyV3lncejoOlb3SBEgimITk6NUTZ4Jn7YmCht3k9bdBPNGjSDg4u3Nm kdOLKw1I3KY+T9UsWEadK0n8E82qbluq8IWz/bs9V5dCGrDiWPr8byRFO/QgAznK29FP RWV59BiO50rLO9SEJYFSGjDypmcRSixeX8729ZI8vJ4StELudID5m/MTCLBmjTpys01b kK3A== X-Gm-Message-State: APjAAAXSSzxTUg9aiHDpvGu6tPIMlR/uUyGblFFVq/RiC67Eq0gStkZz DpL6kyy/Ed/98G6uxgG6aGpvG+JOC7L/X5s/uYs= X-Received: by 2002:a05:6830:20cd:: with SMTP id z13mr57759947otq.168.1555539071987; Wed, 17 Apr 2019 15:11:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 18 Apr 2019 00:10:59 +0200 Message-ID: Subject: Re: [PATCH v2 0/7] CPPC optional registers AMD support To: "Ghannam, Yazen" Cc: "Rafael J. Wysocki" , "Natarajan, Janakarajan" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "devel@acpica.org" , "Rafael J . Wysocki" , Len Brown , Viresh Kumar , Robert Moore , Erik Schmauss 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 Wed, Apr 17, 2019 at 7:28 PM Ghannam, Yazen wrote: > > > -----Original Message----- > > From: Rafael J. Wysocki > > Sent: Tuesday, April 16, 2019 4:34 AM > > To: Natarajan, Janakarajan > > Cc: Natarajan, Janakarajan ; linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org; linux- > > pm@vger.kernel.org; devel@acpica.org; Rafael J . Wysocki ; Len Brown ; Viresh Kumar > > ; Robert Moore ; Erik Schmauss ; Ghannam, Yazen > > > > Subject: Re: [PATCH v2 0/7] CPPC optional registers AMD support > > > > On Tue, Apr 16, 2019 at 12:35 AM Janakarajan Natarajan wrote: > > > > > > On 4/4/19 4:25 PM, Natarajan, Janakarajan wrote: > > > > CPPC (Collaborative Processor Performance Control) offers optional > > > > registers which can be used to tune the system based on energy and/or > > > > performance requirements. > > > > > > > > Newer AMD processors add support for a subset of these optional CPPC > > > > registers, based on ACPI v6.1. > > > > > > > > The following are the supported CPPC registers for which sysfs entries > > > > are created: > > > > * enable (NEW) > > > > * max_perf (NEW) > > > > * min_perf (NEW) > > > > * energy_perf > > > > * lowest_perf > > > > * nominal_perf > > > > * desired_perf (NEW) > > > > * feedback_ctrs > > > > * auto_sel_enable (NEW) > > > > * lowest_nonlinear_perf > > > > > > > > The CPPC driver is updated to enable the OSPM and the userspace to > > > > access > > > > the newly supported registers. > > > > > > > > The purpose of exposing the registers via the sysfs entries is to allow > > > > the userspace to: > > > > * Tweak the values to fit its workload. > > > > * Apply a profile from AMD's optimization guides. > > > > > > > > Profiles will be documented in the performance/optimization guides. > > > > > > > > Note: > > > > * AMD systems will not have a policy applied in the kernel at this time. > > > > * By default, acpi_cpufreq will still be used. > > > > > > > > TODO: > > > > * Create a linux userspace tool that will help users generate a CPPC > > > > * profile > > > > for their target workload. > > > > * Create or update a driver to apply a general CPPC policy in the > > > > * kernel. > > > > > > > > v1->v2: > > > > * Add macro to ensure BUFFER only registers have BUFFER type. > > > > * Add support macro to make the right check based on register type. > > > > * Remove support checks for registers which are mandatory. > > > > > > > > > Are there any concerns regarding this patchset? > > > > Yes, there are. > > > > Unfortunately, it is generally problematic. > > > > First off, the behavior of existing sysfs files cannot be changed at > > will, as there may be users of them out there already depending on the > > current behavior. > > > > The intent is to add new sysfs files without changing the existing files. Is that okay? > > Or is the addition of new files also not acceptable? > > > Second, at least some CPPC control registers are used by cpufreq > > drivers (cppc_cpufreq and intel_pstate), so modifying them behind the > > drivers' backs is not a good idea in general. For this reason, adding > > new sysfs attributes to allow user space to do that is quite > > questionable. > > > > Yes, good point. > > What if a check is added so that writes only succeed if the CPUFREQ governor is set to userspace? That wouldn't be particularly straightforward IMO. What about handling this like the others do, through a proper cpufreq driver?