Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp350443pxu; Wed, 7 Oct 2020 05:00:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJihQPfDq0q6c+PlZx2vVScFsr2c/MZ8dkwJ8wE5ZYpHXdUFkpksvstjui5gxVYX7jLUSX X-Received: by 2002:aa7:c5c4:: with SMTP id h4mr1124097eds.379.1602072041521; Wed, 07 Oct 2020 05:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602072041; cv=none; d=google.com; s=arc-20160816; b=kHldEXapIXO3edukyQouyNZSZ6C/huOP6BEFcfaR3whWepXBNEQg6m2d9AuLacNWBT CXU5bsUYlFH/Go6xNmw/ItPLzlHYye1D6V97IRdzurK//hDC7Jcj725adzGHTAEalIPp 2b/NogiGyafTFpOR1kzw6QYDa9l5PI5uf8QvyOU7a4fuZuisILEp4QidzecxdfIiZK0I VbMCGSlTIOXbhFfVidCLsip1+3keLwrlkK8a1UFp1vMVyI2Si2sRT+hwHLbgwzXR5YIY JwyixuiSz0Rl4YuWX5fAXer7neRAr/DLDELHGbN5pMhBXl7Spr2WtRYZmMipbk/2RMzT mOJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=zxsPTgp9lKZ0SWm5h6n5K4LDeSV9AyL5jIAXG9e9Ecg=; b=t0wpi6jjdPpV8bVnXelcNCp+/bjsq8TFTJrSM5nsws8IJo3cy4Cgkqv9BymnNGiqQO xrVIqDUDIizpJwdvoQ7iQSNrqUm3G2HVI8iBhBNMpj84mygyK60LSeateOnzK5CHQBwl ximXebdRH7OGXp72UQk2cX4qdwNyvMcSc2xCWIxaA9AXNP1DI9CrWXbyWEzhO6462rMC uIx7qLxAoYSw1EWqILMtaIfBnpBD7/hnmTfnBniKmXKfj1WR+Z+SmfiPKT3PUqAmZP6c wcSM+k05cfZY47LOu2DbbUmBTRzU6l/3P0Vw6iiSVChb1/ro0Tf4jHAdl3TTf8Z0calR GFPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o25si1386617edz.114.2020.10.07.05.00.17; Wed, 07 Oct 2020 05:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728034AbgJGL6Z (ORCPT + 99 others); Wed, 7 Oct 2020 07:58:25 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:35804 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgJGL6Z (ORCPT ); Wed, 7 Oct 2020 07:58:25 -0400 Received: from relay11.mail.gandi.net (unknown [217.70.178.231]) by mslow2.mail.gandi.net (Postfix) with ESMTP id BF1DF3B64F5; Wed, 7 Oct 2020 11:52:15 +0000 (UTC) Received: from [192.168.0.28] (lns-bzn-39-82-255-60-242.adsl.proxad.net [82.255.60.242]) (Authenticated sender: hadess@hadess.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 3A8A3100012; Wed, 7 Oct 2020 11:51:47 +0000 (UTC) Message-ID: <85a36eb58cb9774f1907582dfc75295ed847200c.camel@hadess.net> Subject: Re: [RFC] Documentation: Add documentation for new performance_profile sysfs class From: Bastien Nocera To: "Limonciello, Mario" , Hans de Goede , Darren Hart , Andy Shevchenko , Mark Gross Cc: Mark Pearson , Elia Devito , Benjamin Berg , "linux-pm@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Mark Pearson Date: Wed, 07 Oct 2020 13:51:47 +0200 In-Reply-To: References: <20201003131938.9426-1-hdegoede@redhat.com> <20201003131938.9426-2-hdegoede@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.0 (3.38.0-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-10-05 at 12:58 +0000, Limonciello, Mario wrote: > > On modern systems CPU/GPU/... performance is often dynamically > > configurable > > in the form of e.g. variable clock-speeds and TPD. The performance > > is often > > automatically adjusted to the load by some automatic-mechanism > > (which may > > very well live outside the kernel). > > > > These auto performance-adjustment mechanisms often can be > > configured with > > one of several performance-profiles, with either a bias towards > > low-power > > consumption (and cool and quiet) or towards performance (and higher > > power > > consumption and thermals). > > > > Introduce a new performance_profile class/sysfs API which offers a > > generic > > API for selecting the performance-profile of these automatic- > > mechanisms. > > > > If introducing an API for this - let me ask the question, why even let each > driver offer a class interface and userspace need to change "each" driver's > performance setting? > > I would think that you could just offer something kernel-wide like > /sys/power/performance-profile > > Userspace can read and write to a single file.  All drivers can get notified > on this sysfs file changing. > > The systems that react in firmware (such as the two that prompted > this discussion) can change at that time.  It leaves the possibility for a > more open kernel implementation that can do the same thing though too by > directly modifying device registers instead of ACPI devices. The problem, as I've mentioned in previous discussions we had about this, is that, as you've seen in replies to this mail, this would suddenly be making the kernel apply policy. There's going to be pushback as soon as policy is enacted in the kernel, and you take away the different knobs for individual components (or you can control them centrally as well as individually). As much as I hate the quantity of knobs[1], I don't think that trying to reduce the number of knobs in the kernel is a good use of our time, and easier to enact, coordinated with design targets, in user-space. Unless you can think of a way to implement this kernel wide setting without adding one more exponent on the number of possibilities for the testing matrix, I'll +1 Hans' original API. Cheers [1]: https://ometer.com/preferences.html