Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1185711pxu; Fri, 16 Oct 2020 06:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaSuDllQ32B3niU4O6PO0tK0DpSTIdhYxyWZSwSA2UE9dPdMNm6rK1PMjgChdGts2iAZro X-Received: by 2002:aa7:d7ce:: with SMTP id e14mr4026595eds.258.1602853760734; Fri, 16 Oct 2020 06:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602853760; cv=none; d=google.com; s=arc-20160816; b=w9uBlBHIvBg5oOEcI+urHbEXn1MsJAecNEJ6EeBrISLE6Xpnu9lsV2lzMUn+3MEW/G 9r2rSTkOFInFHiEgzXPbh5pDxsgI3/0WcT84MLngXDgPtlXsVOQWoocSPnbbel4p9irA XGaVTyRsfV/6evPFJGQn3Cz5WIEtheeO4Xk9Q3vDs2zUBNVlC11uGlDkRD27clzSPAOl kuS3EgQbg8Z0XzrjNgm1lVtBWQFBym9Zb5UN6QZxR/PNg728+NNvfOsaWhdD1oChRNvO IYE0a++YpdnWhF6UXEFQwGryNubuB8rFuTnt2JF96KBg8B+mB5UGD2f+URMPth0OBLGD PASg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=kOERbbEx7nVCNHLlMb3rSnmIO9vt1UAO946lTC4L+xc=; b=a7gFmg1x8FoLjAuS7RBtGXnbBDOlpA8cv8/HTIh+95sycZY3s7MZRozHrI+gNh5wX9 jaGzstXTZW3mDUkKFj8HZUlex4iZaVtaa7woOdhcua+ZGf62mriMxEWks0FaQtDLoaCh CROIBfjKEnyrXc2NyviGwDTqImSgTXrBGrB+OCw1loWKyIW8dT14+hsXmP3THN5ZUoV4 nioqmBIdNwz9RnydFjq7btdFYYu7nj6ZAAjfSev1BAq/L/jrUebLY8A9549aQUq+Skcv f6EYRFw5hgOhwLZqgG2w0V7i7bD6WsCzEo0ZzM6/jMs5EDCudz6TdSmpm+fhtuWPs1xe 0dNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BgyFuUhG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba12si1506793edb.470.2020.10.16.06.08.56; Fri, 16 Oct 2020 06:09:20 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BgyFuUhG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406782AbgJPLLB (ORCPT + 99 others); Fri, 16 Oct 2020 07:11:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24124 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406689AbgJPLLB (ORCPT ); Fri, 16 Oct 2020 07:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602846659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kOERbbEx7nVCNHLlMb3rSnmIO9vt1UAO946lTC4L+xc=; b=BgyFuUhGCHc+CNlaVEuKhwjT5d+oq5e8MTD/j4q+KNLi+COldA4ou1ihtHMRfISDioVEFZ ozf+8GaCS2DUDa7rFRyl90hzpPSvzdlg96QTJfMplNCUC0jXZEj3eUBmDlPNWjMmw5W3V3 xzBZXaRIttxh6m4X1U9D8oL0WWeyI7w= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-177-_IpVryykORaH6Pybq2FA2Q-1; Fri, 16 Oct 2020 07:10:57 -0400 X-MC-Unique: _IpVryykORaH6Pybq2FA2Q-1 Received: by mail-ej1-f70.google.com with SMTP id z25so797222ejd.2 for ; Fri, 16 Oct 2020 04:10:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kOERbbEx7nVCNHLlMb3rSnmIO9vt1UAO946lTC4L+xc=; b=uEbf8xUE2FY4xJ3JwTD08eh5AhfSquP+B+/14CW+IwRBZng1toFTbv37OTie0c6PKf JQTrgw/1Y0UHjEQ+iKMGxBSmxlNIV/iI5g2sENYFKZk+lJUTIBbos9wE8lLlBAQ4VKZE XRQ7oT0BZQzsjicmd5kjks8xzOl4H53VLwj43SX/8gIXwoEpk0IA+ithN2GjFp3SuCIP oxKQqv+quhquF6sRlDwsLzfzp7oi1igp34X6USILPiwIfA583ptq5qNy9YTDTScNcLkd /EqIXwc3SZ/ejTbSCEIWpOzKRUGUgDYjpETzhdqThAqN+w0U8vORIfihYVXedTE92vgZ OSwA== X-Gm-Message-State: AOAM531/Dqp4HijWVXo9/YXpxWSmCn3DyEkNu0vBlGh7/XLvKvvSI7Kw ITawpu1++4SvcGjwWPkj/TVICwwjxoAODwOslv0WiJ4IpC3E9S89dtCUxnZAMqrP0AZ3dMdvBRX QIxKOPq6lIYHZ4XQneWfIDAPW X-Received: by 2002:a50:c309:: with SMTP id a9mr3223884edb.199.1602846656312; Fri, 16 Oct 2020 04:10:56 -0700 (PDT) X-Received: by 2002:a50:c309:: with SMTP id a9mr3223845edb.199.1602846655995; Fri, 16 Oct 2020 04:10:55 -0700 (PDT) Received: from x1.localdomain (2001-1c00-0c0c-fe00-d2ea-f29d-118b-24dc.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:d2ea:f29d:118b:24dc]) by smtp.gmail.com with ESMTPSA id 11sm1321247ejy.19.2020.10.16.04.10.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Oct 2020 04:10:55 -0700 (PDT) Subject: Re: [RFC] Documentation: Add documentation for new performance_profile sysfs class (Also Re: [PATCH 0/4] powercap/dtpm: Add the DTPM framework) To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Srinivas Pandruvada , Lukasz Luba , Linux Kernel Mailing List , Linux PM , "Zhang, Rui" , Bastien Nocera , Mark Pearson , "Limonciello, Mario" , Darren Hart , Andy Shevchenko , Mark Gross , Elia Devito , Benjamin Berg , "linux-acpi@vger.kernel.org" , "platform-driver-x86@vger.kernel.org" References: <20201006122024.14539-1-daniel.lezcano@linaro.org> <8be66efd-7833-2c8a-427d-b0055c2f6ec1@linaro.org> <97e5368b-228d-eca1-85a5-b918dfcfd336@redhat.com> <63dfa6a1-0424-7985-7803-756c0c5cc4a5@redhat.com> <87d9a808-39d6-4949-c4f9-6a80d14a3768@redhat.com> From: Hans de Goede Message-ID: <943531a7-74d6-7c7f-67bc-2645b3ba7b8a@redhat.com> Date: Fri, 16 Oct 2020 13:10:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/14/20 5:42 PM, Rafael J. Wysocki wrote: > On Wed, Oct 14, 2020 at 4:06 PM Hans de Goede wrote: >> On 10/14/20 3:33 PM, Rafael J. Wysocki wrote: >>> First, a common place to register a DPTF system profile seems to be >>> needed and, as I said above, I wouldn't expect more than one such >>> thing to be present in the system at any given time, so it may be >>> registered along with the list of supported profiles and user space >>> will have to understand what they mean. >> >> Mostly Ack, I would still like to have an enum for DPTF system >> profiles in the kernel and have a single piece of code map that >> enum to profile names. This enum can then be extended as >> necessary, but I want to avoid having one driver use >> "Performance" and the other "performance" or one using >> "performance-balanced" and the other "balanced-performance", etc. >> >> With the goal being that new drivers use existing values from >> the enum as much as possible, but we extend it where necessary. > > IOW, just a table of known profile names with specific indices assigned to them. Yes. > This sounds reasonable. > >>> Second, irrespective of the above, it may be useful to have a >>> consistent way to pass performance-vs-power preference information >>> from user space to different parts of the kernel so as to allow them >>> to adjust their operation and this could be done with a system-wide >>> power profile attribute IMO. >> >> I agree, which is why I tried to tackle both things in one go, >> but as you said doing both in 1 API is probably not the best idea. >> So I believe we should park this second issue for now and revisit it >> when we find a need for it. > > Agreed. > >> Do you have any specific userspace API in mind for the >> DPTF system profile selection? > > Not really. So before /sys/power/profile was mentioned, but that seems more like a thing which should have a set of fixed possible values, iow that is out of scope for this discussion. Since we all seem to agree that this is something which we need specifically for DPTF profiles maybe just add: /sys/power/dptf_current_profile (rw) /sys/power/dptf_available_profiles (ro) (which will only be visible if a dptf-profile handler has been registered) ? Or more generic and thus better (in case other platforms later need something similar) I think, mirror the: /sys/bus/cpu/devices/cpu#/cpufreq/energy_performance_* bits for a system-wide energy-performance setting, so we get: /sys/power/energy_performance_preference /sys/power/energy_performance_available_preferences (again only visible when applicable) ? I personally like the second option best. Regards, Hans