All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
@ 2024-05-02 23:30 ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2024-05-02 23:30 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland

Add the __init marking to validate_timer_rate() so that it gets
discarded after init.

  $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
  Function                                     old     new   delta
  arch_timer_register                         1724    1716      -8
  Total: Before=69177808, After=69177800, chg -0.00%

Cc: Jisheng Zhang <jszhang@kernel.org>
Cc: Ionela Voinescu <ionela.voinescu@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 8d4a52056684..9c4a4af25d2c 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1045,7 +1045,7 @@ static int arch_timer_starting_cpu(unsigned int cpu)
 	return 0;
 }
 
-static int validate_timer_rate(void)
+static int __init validate_timer_rate(void)
 {
 	if (!arch_timer_rate)
 		return -EINVAL;

base-commit: 4cece764965020c22cff7665b18a012006359095
-- 
https://chromeos.dev


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
@ 2024-05-02 23:30 ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2024-05-02 23:30 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland

Add the __init marking to validate_timer_rate() so that it gets
discarded after init.

  $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
  Function                                     old     new   delta
  arch_timer_register                         1724    1716      -8
  Total: Before=69177808, After=69177800, chg -0.00%

Cc: Jisheng Zhang <jszhang@kernel.org>
Cc: Ionela Voinescu <ionela.voinescu@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 8d4a52056684..9c4a4af25d2c 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1045,7 +1045,7 @@ static int arch_timer_starting_cpu(unsigned int cpu)
 	return 0;
 }
 
-static int validate_timer_rate(void)
+static int __init validate_timer_rate(void)
 {
 	if (!arch_timer_rate)
 		return -EINVAL;

base-commit: 4cece764965020c22cff7665b18a012006359095
-- 
https://chromeos.dev


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
  2024-05-02 23:30 ` Stephen Boyd
@ 2024-05-03 11:27   ` Mukesh Ojha
  -1 siblings, 0 replies; 6+ messages in thread
From: Mukesh Ojha @ 2024-05-03 11:27 UTC (permalink / raw)
  To: Stephen Boyd, Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland



On 5/3/2024 5:00 AM, Stephen Boyd wrote:
> Add the __init marking to validate_timer_rate() so that it gets
> discarded after init.
> 
>    $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
>    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
>    Function                                     old     new   delta
>    arch_timer_register                         1724    1716      -8

Have not used this tool bloat-o-meter
Just a question, why is it showing arch_timer_register is shrunk ?

-Mukesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
@ 2024-05-03 11:27   ` Mukesh Ojha
  0 siblings, 0 replies; 6+ messages in thread
From: Mukesh Ojha @ 2024-05-03 11:27 UTC (permalink / raw)
  To: Stephen Boyd, Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland



On 5/3/2024 5:00 AM, Stephen Boyd wrote:
> Add the __init marking to validate_timer_rate() so that it gets
> discarded after init.
> 
>    $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
>    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
>    Function                                     old     new   delta
>    arch_timer_register                         1724    1716      -8

Have not used this tool bloat-o-meter
Just a question, why is it showing arch_timer_register is shrunk ?

-Mukesh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
  2024-05-03 11:27   ` Mukesh Ojha
@ 2024-05-04  5:59     ` Stephen Boyd
  -1 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2024-05-04  5:59 UTC (permalink / raw)
  To: Daniel Lezcano, Mukesh Ojha, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland

Quoting Mukesh Ojha (2024-05-03 04:27:52)
>
>
> On 5/3/2024 5:00 AM, Stephen Boyd wrote:
> > Add the __init marking to validate_timer_rate() so that it gets
> > discarded after init.
> >
> >    $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
> >    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
> >    Function                                     old     new   delta
> >    arch_timer_register                         1724    1716      -8
>
> Have not used this tool bloat-o-meter
> Just a question, why is it showing arch_timer_register is shrunk ?

Hmm good question. There shouldn't be any difference if it gets inlined.

It's an allmodconfig build. It looks like that causes noise in the build so it
isn't stable. :( I diffed the objdump and the function is missing this ror and
nop instruction. But then I built it again, and it became more different. If I
build an allnoconfig it has zero difference.

Before:

  ffff800083021ed4:       974ba12d        bl      ffff80008030a388
<free_percpu_irq>
  ffff800083021ed8:       93d3f273        ror     x19, x19, #60
  ffff800083021edc:       d503201f        nop
  ffff800083021ee0:       d29858e0        mov     x0, #0xc2c7
           // #49863
  ffff800083021ee4:       910102b6        add     x22, x21, #0x40
  ffff800083021ee8:       f2aeea20        movk    x0, #0x7751, lsl #16
  ffff800083021eec:       f2ce7680        movk    x0, #0x73b4, lsl #32
  ffff800083021ef0:       f2f09e20        movk    x0, #0x84f1, lsl #48
  ffff800083021ef4:       ca000273        eor     x19, x19, x0
  ffff800083021ef8:       97527f02        bl      ffff8000804c1b00
<__sanitizer_cov_trace_pc>

After:

  ffff800083021ed4:       974ba12d        bl      ffff80008030a388
<free_percpu_irq>
  ffff800083021ed8:       d29f9f00        mov     x0, #0xfcf8
           // #64760
  ffff800083021edc:       910102b6        add     x22, x21, #0x40
  ffff800083021ee0:       f2b03940        movk    x0, #0x81ca, lsl #16
  ffff800083021ee4:       f2d5e700        movk    x0, #0xaf38, lsl #32
  ffff800083021ee8:       f2ee1340        movk    x0, #0x709a, lsl #48
  ffff800083021eec:       ca000273        eor     x19, x19, x0
  ffff800083021ef0:       97527f04        bl      ffff8000804c1b00
<__sanitizer_cov_trace_pc>

Maybe kcov is making things different?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init
@ 2024-05-04  5:59     ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2024-05-04  5:59 UTC (permalink / raw)
  To: Daniel Lezcano, Mukesh Ojha, Thomas Gleixner
  Cc: linux-kernel, patches, linux-arm-kernel, Jisheng Zhang,
	Ionela Voinescu, Marc Zyngier, Mark Rutland

Quoting Mukesh Ojha (2024-05-03 04:27:52)
>
>
> On 5/3/2024 5:00 AM, Stephen Boyd wrote:
> > Add the __init marking to validate_timer_rate() so that it gets
> > discarded after init.
> >
> >    $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after
> >    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
> >    Function                                     old     new   delta
> >    arch_timer_register                         1724    1716      -8
>
> Have not used this tool bloat-o-meter
> Just a question, why is it showing arch_timer_register is shrunk ?

Hmm good question. There shouldn't be any difference if it gets inlined.

It's an allmodconfig build. It looks like that causes noise in the build so it
isn't stable. :( I diffed the objdump and the function is missing this ror and
nop instruction. But then I built it again, and it became more different. If I
build an allnoconfig it has zero difference.

Before:

  ffff800083021ed4:       974ba12d        bl      ffff80008030a388
<free_percpu_irq>
  ffff800083021ed8:       93d3f273        ror     x19, x19, #60
  ffff800083021edc:       d503201f        nop
  ffff800083021ee0:       d29858e0        mov     x0, #0xc2c7
           // #49863
  ffff800083021ee4:       910102b6        add     x22, x21, #0x40
  ffff800083021ee8:       f2aeea20        movk    x0, #0x7751, lsl #16
  ffff800083021eec:       f2ce7680        movk    x0, #0x73b4, lsl #32
  ffff800083021ef0:       f2f09e20        movk    x0, #0x84f1, lsl #48
  ffff800083021ef4:       ca000273        eor     x19, x19, x0
  ffff800083021ef8:       97527f02        bl      ffff8000804c1b00
<__sanitizer_cov_trace_pc>

After:

  ffff800083021ed4:       974ba12d        bl      ffff80008030a388
<free_percpu_irq>
  ffff800083021ed8:       d29f9f00        mov     x0, #0xfcf8
           // #64760
  ffff800083021edc:       910102b6        add     x22, x21, #0x40
  ffff800083021ee0:       f2b03940        movk    x0, #0x81ca, lsl #16
  ffff800083021ee4:       f2d5e700        movk    x0, #0xaf38, lsl #32
  ffff800083021ee8:       f2ee1340        movk    x0, #0x709a, lsl #48
  ffff800083021eec:       ca000273        eor     x19, x19, x0
  ffff800083021ef0:       97527f04        bl      ffff8000804c1b00
<__sanitizer_cov_trace_pc>

Maybe kcov is making things different?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-04  6:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 23:30 [PATCH] clocksource/drivers/arm_arch_timer: Mark validate_timer_rate() init Stephen Boyd
2024-05-02 23:30 ` Stephen Boyd
2024-05-03 11:27 ` Mukesh Ojha
2024-05-03 11:27   ` Mukesh Ojha
2024-05-04  5:59   ` Stephen Boyd
2024-05-04  5:59     ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.