* Re: [PATCH v5 08/13] ACPI: add perf low power callback
[not found] ` <20220126233454.3362047-9-eranian@google.com>
@ 2022-01-27 13:06 ` Peter Zijlstra
2022-02-01 7:33 ` Stephane Eranian
0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2022-01-27 13:06 UTC (permalink / raw)
To: Stephane Eranian
Cc: linux-kernel, kim.phillips, acme, jolsa, songliubraving,
Rafael J. Wysocki, linux-acpi
On Wed, Jan 26, 2022 at 03:34:49PM -0800, Stephane Eranian wrote:
> This patch add an optional callback needed by some PMU features, e.g., AMD
"This patch" is a documented fail.
> BRS, to give a chance to the perf_events code to change its state before
> going to low power and after coming back.
>
> The callback is void when the PERF_NEEDS_LOPWR_CB flag is not set.
> This flag must be set in arch specific perf_event.h header whenever needed.
> When not set, there is no impact of the ACPI code.
>
> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---
> drivers/acpi/acpi_pad.c | 6 ++++++
> drivers/acpi/processor_idle.c | 5 +++++
> include/linux/perf_event.h | 6 ++++++
> 3 files changed, 17 insertions(+)
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index f45979aa2d64..a306a07a60b5 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -164,6 +164,9 @@ static int power_saving_thread(void *data)
> tsc_marked_unstable = 1;
> }
> local_irq_disable();
> +
> + perf_lopwr_cb(true);
> +
> tick_broadcast_enable();
> tick_broadcast_enter();
> stop_critical_timings();
> @@ -172,6 +175,9 @@ static int power_saving_thread(void *data)
>
> start_critical_timings();
> tick_broadcast_exit();
> +
> + perf_lopwr_cb(false);
> +
> local_irq_enable();
>
> if (time_before(expire_time, jiffies)) {
You forgot to Cc the maintainers of this stinking pile of poo. Can we
please delete it instead?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5 08/13] ACPI: add perf low power callback
2022-01-27 13:06 ` [PATCH v5 08/13] ACPI: add perf low power callback Peter Zijlstra
@ 2022-02-01 7:33 ` Stephane Eranian
2022-02-01 10:20 ` Peter Zijlstra
0 siblings, 1 reply; 3+ messages in thread
From: Stephane Eranian @ 2022-02-01 7:33 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-kernel, kim.phillips, acme, jolsa, songliubraving,
Rafael J. Wysocki, linux-acpi
On Thu, Jan 27, 2022 at 5:06 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Jan 26, 2022 at 03:34:49PM -0800, Stephane Eranian wrote:
> > This patch add an optional callback needed by some PMU features, e.g., AMD
>
> "This patch" is a documented fail.
>
I understand this is not ideal. But the BRS feature must be disabled
before going low-power.
Do you have a better proposal? Been trying to find the simplest way to
support this with no
impact when not needed.
> > BRS, to give a chance to the perf_events code to change its state before
> > going to low power and after coming back.
> >
> > The callback is void when the PERF_NEEDS_LOPWR_CB flag is not set.
> > This flag must be set in arch specific perf_event.h header whenever needed.
> > When not set, there is no impact of the ACPI code.
> >
> > Signed-off-by: Stephane Eranian <eranian@google.com>
> > ---
> > drivers/acpi/acpi_pad.c | 6 ++++++
> > drivers/acpi/processor_idle.c | 5 +++++
> > include/linux/perf_event.h | 6 ++++++
> > 3 files changed, 17 insertions(+)
> >
> > diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> > index f45979aa2d64..a306a07a60b5 100644
> > --- a/drivers/acpi/acpi_pad.c
> > +++ b/drivers/acpi/acpi_pad.c
> > @@ -164,6 +164,9 @@ static int power_saving_thread(void *data)
> > tsc_marked_unstable = 1;
> > }
> > local_irq_disable();
> > +
> > + perf_lopwr_cb(true);
> > +
> > tick_broadcast_enable();
> > tick_broadcast_enter();
> > stop_critical_timings();
> > @@ -172,6 +175,9 @@ static int power_saving_thread(void *data)
> >
> > start_critical_timings();
> > tick_broadcast_exit();
> > +
> > + perf_lopwr_cb(false);
> > +
> > local_irq_enable();
> >
> > if (time_before(expire_time, jiffies)) {
>
> You forgot to Cc the maintainers of this stinking pile of poo. Can we
> please delete it instead?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5 08/13] ACPI: add perf low power callback
2022-02-01 7:33 ` Stephane Eranian
@ 2022-02-01 10:20 ` Peter Zijlstra
0 siblings, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2022-02-01 10:20 UTC (permalink / raw)
To: Stephane Eranian
Cc: linux-kernel, kim.phillips, acme, jolsa, songliubraving,
Rafael J. Wysocki, linux-acpi
On Mon, Jan 31, 2022 at 11:33:10PM -0800, Stephane Eranian wrote:
> On Thu, Jan 27, 2022 at 5:06 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Jan 26, 2022 at 03:34:49PM -0800, Stephane Eranian wrote:
> > > This patch add an optional callback needed by some PMU features, e.g., AMD
> >
> > "This patch" is a documented fail.
> >
> I understand this is not ideal.
git grep -i "this patch" Documentation/process/submitting-patches.rst
"Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
to do frotz", as if you are giving orders to the codebase to change
its behaviour."
IOW, don't use "This patch" to start a Changelog (lot's of your patches
here do so).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-01 10:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220126233454.3362047-1-eranian@google.com>
[not found] ` <20220126233454.3362047-9-eranian@google.com>
2022-01-27 13:06 ` [PATCH v5 08/13] ACPI: add perf low power callback Peter Zijlstra
2022-02-01 7:33 ` Stephane Eranian
2022-02-01 10:20 ` Peter Zijlstra
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).