Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1452955rwl; Fri, 31 Mar 2023 11:18:37 -0700 (PDT) X-Google-Smtp-Source: AKy350b/FAAxRknnwA+g3oL4BgwvEGqRndnKQHD1X2yCNMLFtaFsA9t9/+UUqJ8YaBEyt1Ux8T7F X-Received: by 2002:a05:6a20:748c:b0:cd:fc47:dd74 with SMTP id p12-20020a056a20748c00b000cdfc47dd74mr7644481pzd.4.1680286716923; Fri, 31 Mar 2023 11:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680286716; cv=none; d=google.com; s=arc-20160816; b=AxQJu10bY4W9ZvMHSgzfVGrGuaJAgRgAzTfaLdtFpemnqbnKKl9dPPCF/AtNpWXdvm a2R0QAvxhARuZXSuJkZmM9qXOIFB8oWjFbGGtUc2uv+y6xPwh9C8jWbLlYJcqiyu37xJ TxjkbQrv0IvEpwFjpNoCe1AthX14qh/kgYIg1Ulyo52gXMrPclk+Dn6jDs0pYDVLqm4Q BDN9J/SGodk/BrQJIdgh/iE+Az1flGJbZAskurHQLGPGWmwlDkfw+LCPrpitSPC0X3AX oXbm613GkjtGX6SCGaHKPtm9rH6ZaqVjBUoQdn+U/zTCrdBXz4/fBLlOdE2PGMT+pGRL Lamw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=piM4dHjZR3HB8GnSLbuqNmO5u5yvngnkqWkJ/tfVwDA=; b=qAZkB5Wkio67qzXLfzXVKVyzl5O3udRrpG+4EeRDoR2bCEe3QmFsQzyZVbt91/0rPG yQHF9/MyhzDaeGccoDF10CLWlOh/vzE7vPH+oCSLUu618cMGY/z3CPD89ON/UJVd0vf3 iulY3jP8oLLJeWQJioS9Czkpu2JemivLeYsDwJ+dE9ILrIb2t4oHiT35dRuDh668tdZC dLOutJo2/CQzoxmX6/h9SpifwjD/MeDtSWIqOz4dYMDZo1NaeCtCs2lO6Bwcv87fPSca PMApZrlXLDzCt4OVdvfDyYqtfhb2vftfpL8JsP8a2FNYydrfkCfp9lA2bw3LgE6Bx1Ts RQNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o8-20020aa79788000000b005a910ae9a76si3003974pfp.305.2023.03.31.11.18.25; Fri, 31 Mar 2023 11:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232710AbjCaSHS convert rfc822-to-8bit (ORCPT + 99 others); Fri, 31 Mar 2023 14:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbjCaSHR (ORCPT ); Fri, 31 Mar 2023 14:07:17 -0400 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856EB1207F; Fri, 31 Mar 2023 11:07:15 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id t10so92770904edd.12; Fri, 31 Mar 2023 11:07:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680286034; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jOn1S9dAKkyYTe62ni2NBuSexnnOc4tSxOCRbbZ+YgA=; b=4RC5bXMHcW7j+psVmO8e8G4Gx+HbNHveGcPW9AtwO40O5OMEUzTBcUXCc5kZ4lzW60 TvXjI+2xfuXYwYEnKt4x8ugnO4nTv6etxa8Ewh8NWSWSQuTaj2WXAtNe3Y5T25M0YAIJ R1Q5nL9cJceXCYwSgqwRzsOeEv4uoDW8QumUNfVqTAuZKTNfFtUWWRh8Dqq/GLuKwqkH bR77r0h3eQp2zbLTFxBw42xtCBdV4qF2jTB98ersnXrDNNZhVfrzgYYj7vRT6dGUzlb1 VK+eaVjCfvBiQr7z/u1nm3HxfHhtuyv8ZyjRAdTtP6SRxNGhCwqN0u4p51OhnAsshbL+ NROQ== X-Gm-Message-State: AAQBX9fn13MJCvjLwGUc1wSkbprL2tb+P6xPNQCvzCDnke2NHOyP2dow JEGNIzRUwdoprZD49mc7owj8LiSPUufAivsRcabB1lEO X-Received: by 2002:a17:907:d48d:b0:93e:c1ab:ae67 with SMTP id vj13-20020a170907d48d00b0093ec1abae67mr13069942ejc.2.1680286034047; Fri, 31 Mar 2023 11:07:14 -0700 (PDT) MIME-Version: 1.0 References: <20230330194439.14361-1-mario.limonciello@amd.com> <20230330194439.14361-2-mario.limonciello@amd.com> <2676888c-e93f-53aa-a4f7-e85b66f351c8@amd.com> In-Reply-To: <2676888c-e93f-53aa-a4f7-e85b66f351c8@amd.com> From: "Rafael J. Wysocki" Date: Fri, 31 Mar 2023 20:07:03 +0200 Message-ID: Subject: Re: [PATCH v5 1/4] PM: Add a sysfs file to represent time spent in hardware sleep state To: "Limonciello, Mario" Cc: "Rafael J. Wysocki" , Sven van Ashbrook , John Stultz , Len Brown , Pavel Machek , Raul Rangel , David E Box , Rajat Jain , S-k Shyam-sundar , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2023 at 8:05 PM Limonciello, Mario wrote: > > On 3/31/2023 13:01, Rafael J. Wysocki wrote: > > On Thu, Mar 30, 2023 at 9:45 PM Mario Limonciello > > wrote: > >> > >> Userspace can't easily discover how much of a sleep cycle was spent in a > >> hardware sleep state without using kernel tracing and vendor specific sysfs > >> or debugfs files. > >> > >> To make this information more discoverable, introduce a new sysfs file > >> to represent the time spent in a sleep state. > > > > This is only in the most recent suspend-resume cycle, isn't it? > > Yes; that's correct. > > > > > Wouldn't it be useful to have another attribute printing the > > accumulated total HW sleep time? > > > > I had considered this; but I didn't think it was actually very useful > because userspace will get control at the end of every cycle and can > accumulate those numbers if desirable. Unless "user space" in question is actually a human, that is.