linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Naveen Krishna Chatradhi <nchatrad@amd.com>,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 1/3 v7] hwmon: Add amd_energy driver to report energy counters
Date: Wed, 27 May 2020 20:12:20 +0530	[thread overview]
Message-ID: <CAHfPSqA_0NhpEvn+jAGb3O7uc+EbZDKWajdR_A=RK9Y_-QgKnQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.20.13.2005271703220.18802@monopod.intra.ispras.ru>

Hi Alexander

On Wed, 27 May 2020 at 19:38, Alexander Monakov <amonakov@ispras.ru> wrote:
>
> On Wed, 27 May 2020, Guenter Roeck wrote:
>
> > >> I understand that. If you anticipate that the module may be inserted after a
> > >> wraparound, the driver should populate 'prev_value' with actual counter
> > >> values instead of zeros. That way the driver will properly accumulate
> > >> energy over time it's been inserted. As implemented, the driver counts
> > >> energy since boot time, minus unknown amount lost to wraparounds if the
> > >> driver was loaded too late.
> > > No problem if this module is built into the kernel.
> > > If this module is inserted at later point, unless the user keeps the
> > > counters since
> > > the boot and provide it as an input during the module insert (we can
> > > implement this).
> >
> > I won't accept such a parameter. If you may recall, I did bring this up as
> > reason why I abandoned the matching change for the coretemp driver, predicting
> > that people would complain about it. Now they do. Not surprising. We (and you)
> > will have to live with it.
Yes agree, letting user provide initial values is not appropriate. My bad.

>
> I'm not exactly complaining, I'm proposing a solution: at probe time, populate
> prev_value members with MSR values instead of zeros. That way, the module will
> correctly count energy over the time it's been loaded. It can be unloaded and
> reloaded freely, and doing so would allow to easily measure energy across large
> spans of time, which sounds like an improvement.

In the current driver, the accumulation thread starts during the probe and the
prev_value of sockets and the core0 is updated with the current MSR value.
It takes (nr_cpus - 1) iterations of the thread to populate the prev_value for
the other cores.

By populating prev_value of all the cores during probe, we can
certainly save some
information (values with in one wrap-around at the best). If this
information is
useful, i can submit a patch to do so. Guenter, could you suggest us on this.

>
> I can try to cook a corresponding patch if that sounds alright.
>
> Cheers.
> Alexander



-- 
Shine bright,
(: Nav :)

  reply	other threads:[~2020-05-27 14:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 15:50 [PATCH 1/3 v7] hwmon: Add amd_energy driver to report energy counters Naveen Krishna Chatradhi
2020-05-19 15:50 ` [PATCH 2/3 v7] hwmon: (amd_energy) Add documentation Naveen Krishna Chatradhi
2020-05-19 15:50 ` [PATCH 3/3 v7] MAINTAINERS: add entry for AMD energy driver Naveen Krishna Chatradhi
2020-05-22 13:26 ` [PATCH 1/3 v7] hwmon: Add amd_energy driver to report energy counters Guenter Roeck
2020-05-22 14:19   ` Naveen Krishna Ch
2020-05-26 22:37     ` Alexander Monakov
2020-05-27  3:03       ` Naveen Krishna Ch
2020-05-27  6:59         ` Alexander Monakov
2020-05-27 10:35           ` Naveen Krishna Ch
2020-05-27 13:28             ` Guenter Roeck
2020-05-27 14:08               ` Alexander Monakov
2020-05-27 14:42                 ` Naveen Krishna Ch [this message]
2020-05-27 15:15                   ` Guenter Roeck
2020-05-27 15:25                     ` Alexander Monakov
2020-05-27 15:35                       ` Guenter Roeck
2020-05-27 14:48                 ` Guenter Roeck
2020-05-27 15:12                   ` Alexander Monakov
2020-05-27 15:33                     ` Guenter Roeck
2020-05-27 16:41                       ` Alexander Monakov
2020-05-27 16:57                         ` Guenter Roeck
2020-05-27 17:12                           ` Alexander Monakov
2020-05-27 16:59             ` Alexander Monakov
2020-05-28  4:11               ` Naveen Krishna Ch
2020-06-10 20:21                 ` Alexander Monakov
2020-06-16 14:46                   ` Chatradhi, Naveen Krishna
2020-06-16 14:53                     ` Guenter Roeck
2020-06-16 14:57                       ` Naveen Krishna Ch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHfPSqA_0NhpEvn+jAGb3O7uc+EbZDKWajdR_A=RK9Y_-QgKnQ@mail.gmail.com' \
    --to=naveenkrishna.ch@gmail.com \
    --cc=amonakov@ispras.ru \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nchatrad@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).