diff mbox series

ACPI: processor/idle: Annotate more functions to live in cpuidle section

Message ID 20220607222458.1864805-1-gpiccoli@igalia.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series ACPI: processor/idle: Annotate more functions to live in cpuidle section | expand

Commit Message

Guilherme G. Piccoli June 7, 2022, 10:24 p.m. UTC
Commit 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
introduced a new text section called cpuidle; with that, we have a mechanism
to add idling functions in such section and skip them from nmi_backtrace
output, since they're useless and potentially flooding for such report.

Happens that inlining might cause some real idle functions to end-up
outside of such section; this is currently the case of ACPI processor_idle
driver; the functions acpi_idle_enter_* do inline acpi_idle_do_entry(),
hence they stay out of the cpuidle section.
Fix that by marking such functions to also live in the cpuidle section.

Fixes: 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
Cc: Len Brown <lenb@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
---

Hi folks, this was tested on top of v5.19-rc1, with sysrq-l.

An alternative for this approach would be to mark acpi_idle_do_entry()
as noinline, but I'd risk to say that's a bit worse performance-wise.
Let me know your preference, I can rework the patch if you prefer =)

Thanks in advance for reviews,


Guilherme


 drivers/acpi/processor_idle.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Rafael J. Wysocki June 9, 2022, 6:44 p.m. UTC | #1
On Wed, Jun 8, 2022 at 12:25 AM Guilherme G. Piccoli
<gpiccoli@igalia.com> wrote:
>
> Commit 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
> introduced a new text section called cpuidle; with that, we have a mechanism
> to add idling functions in such section and skip them from nmi_backtrace
> output, since they're useless and potentially flooding for such report.
>
> Happens that inlining might cause some real idle functions to end-up
> outside of such section; this is currently the case of ACPI processor_idle
> driver; the functions acpi_idle_enter_* do inline acpi_idle_do_entry(),
> hence they stay out of the cpuidle section.
> Fix that by marking such functions to also live in the cpuidle section.
>
> Fixes: 6727ad9e206c ("nmi_backtrace: generate one-line reports for idle cpus")
> Cc: Len Brown <lenb@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
> ---
>
> Hi folks, this was tested on top of v5.19-rc1, with sysrq-l.
>
> An alternative for this approach would be to mark acpi_idle_do_entry()
> as noinline, but I'd risk to say that's a bit worse performance-wise.
> Let me know your preference, I can rework the patch if you prefer =)
>
> Thanks in advance for reviews,
>
>
> Guilherme
>
>
>  drivers/acpi/processor_idle.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 6a5572a1a80c..13200969ccf3 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -607,7 +607,7 @@ static DEFINE_RAW_SPINLOCK(c3_lock);
>   * @cx: Target state context
>   * @index: index of target state
>   */
> -static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
> +static int __cpuidle acpi_idle_enter_bm(struct cpuidle_driver *drv,
>                                struct acpi_processor *pr,
>                                struct acpi_processor_cx *cx,
>                                int index)
> @@ -664,7 +664,7 @@ static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
>         return index;
>  }
>
> -static int acpi_idle_enter(struct cpuidle_device *dev,
> +static int __cpuidle acpi_idle_enter(struct cpuidle_device *dev,
>                            struct cpuidle_driver *drv, int index)
>  {
>         struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
> @@ -693,7 +693,7 @@ static int acpi_idle_enter(struct cpuidle_device *dev,
>         return index;
>  }
>
> -static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
> +static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
>                                   struct cpuidle_driver *drv, int index)
>  {
>         struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
> --

Applied as 5.20 material, thanks!
Guilherme G. Piccoli June 9, 2022, 6:50 p.m. UTC | #2
Thank you Rafael =)
diff mbox series

Patch

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 6a5572a1a80c..13200969ccf3 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -607,7 +607,7 @@  static DEFINE_RAW_SPINLOCK(c3_lock);
  * @cx: Target state context
  * @index: index of target state
  */
-static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
+static int __cpuidle acpi_idle_enter_bm(struct cpuidle_driver *drv,
 			       struct acpi_processor *pr,
 			       struct acpi_processor_cx *cx,
 			       int index)
@@ -664,7 +664,7 @@  static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
 	return index;
 }
 
-static int acpi_idle_enter(struct cpuidle_device *dev,
+static int __cpuidle acpi_idle_enter(struct cpuidle_device *dev,
 			   struct cpuidle_driver *drv, int index)
 {
 	struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
@@ -693,7 +693,7 @@  static int acpi_idle_enter(struct cpuidle_device *dev,
 	return index;
 }
 
-static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
+static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
 				  struct cpuidle_driver *drv, int index)
 {
 	struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);