clocksource: arm_arch_timer: unify sched_clock init
Subsystems (19)
PATCH 1/2 clocksource: arm_arch_timer: unify sched_clock init
From: Rob Herring <[email protected]>
In preparation to fix initial time and suspend/resume handling, unify the sched_clock init and implementation for arch timer on arm and arm64.
--- arch/arm/kernel/arch_timer.c | 12 ------------ arch/arm64/kernel/time.c | 10 ---------- drivers/clocksource/arm_arch_timer.c | 14 ++++++++++++++ include/clocksource/arm_arch_timer.h | 1 + 4 files changed, 15 insertions(+), 22 deletions(-)
arch/arm/kernel/arch_timer.c +0 -12
@@ -22,13 +22,6 @@ static unsigned long arch_timer_read_counter_long(void)return arch_timer_read_counter (); } -static u32 sched_clock_mult__read_mostly ; - -static unsigned long long notrace arch_timer_sched_clock (void ) -{ -return arch_timer_read_counter () * sched_clock_mult; -} -static struct delay_timer arch_delay_timer;static void __init arch_timer_delay_timer_register (void )
@@ -48,11 +41,6 @@ int __init arch_timer_arch_init(void)arch_timer_delay_timer_register (); -/* Cache the sched_clock multiplier to save a divide in the hot path. */ - sched_clock_mult =NSEC_PER_SEC / arch_timer_rate; sched_clock_func = arch_timer_sched_clock; -pr_info ("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n" , - arch_timer_rate /1000 , sched_clock_mult); -return 0 ; }
arch/arm64/kernel/time.c +0 -10
@@ -61,13 +61,6 @@ unsigned long profile_pc(struct pt_regs *regs)EXPORT_SYMBOL (profile_pc);#endif -static u64 sched_clock_mult__read_mostly ; - -unsigned long long notrace sched_clock (void ) -{ -return arch_timer_read_counter () * sched_clock_mult; -} -int read_current_timer (unsigned long *timer_value) { *timer_value =arch_timer_read_counter ();
@@ -84,9 +77,6 @@ void __init time_init(void)if (!arch_timer_rate)panic ("Unable to initialise architected timer.\n" ); -/* Cache the sched_clock multiplier to save a divide in the hot path. */ - sched_clock_mult =NSEC_PER_SEC / arch_timer_rate; -/* Calibrate the delay loop directly */ lpj_fine = arch_timer_rate /HZ ; }
drivers/clocksource/arm_arch_timer.c +14 -0
@@ -266,6 +266,15 @@ static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { .notifier_call = arch_timer_cpu_notify, }; +static u64 sched_clock_mult__read_mostly ; + +unsigned long long notrace arch_timer_sched_clock (void ) +{ +return arch_timer_read_counter () * sched_clock_mult; +} +unsigned long long sched_clock (void ) \ + __attribute__((weak,alias ("arch_timer_sched_clock" ))); +static int __init arch_timer_register (void ) {int err;
@@ -318,6 +327,11 @@ static int __init arch_timer_register(void)/* Immediately configure the timer on the boot CPU */ arch_timer_setup (this_cpu_ptr (arch_timer_evt)); +/* Cache the sched_clock multiplier to save a divide in the hot path. */ + sched_clock_mult =NSEC_PER_SEC / arch_timer_rate; +pr_info ("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %lluns\n" , + arch_timer_rate /1000 , sched_clock_mult); +return 0 ; out_free_irq:
include/clocksource/arm_arch_timer.h +1 -0
@@ -34,6 +34,7 @@extern u32 arch_timer_get_rate (void );extern u64 (*arch_timer_read_counter)(void );extern struct timecounter *arch_timer_get_timecounter (void ); +extern unsigned long long notrace arch_timer_sched_clock (void );#else
Signature · 1 line
1.7.10.4
PATCH 2/2 clocksource: arm_arch_timer: add boot and suspend sched_clock offset
From: Rob Herring <[email protected]>
Commit 023796b (ARM: arch_timer: use full 64-bit counter for sched_clock) fails to ensure sched_clock always starts at time 0 and counting is suspended during suspend. arm64 sched_clock support also has the same issues. This fixes all architected timer users by maintaining an initial offset which is updated on resume.
--- arch/arm/kernel/arch_timer.c | 1 + drivers/clocksource/arm_arch_timer.c | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
arch/arm/kernel/arch_timer.c +1 -0
@@ -42,5 +42,6 @@ int __init arch_timer_arch_init(void)arch_timer_delay_timer_register (); sched_clock_func = arch_timer_sched_clock; +return 0 ; }
drivers/clocksource/arm_arch_timer.c +25 -1
@@ -17,6 +17,7 @@#include <linux/interrupt.h> #include <linux/of_irq.h> #include <linux/io.h> +#include <linux/syscore_ops.h> #include <asm/arch_timer.h> #include <asm/virt.h>
@@ -267,14 +268,34 @@ static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { };static u64 sched_clock_mult__read_mostly ; +static u64 arch_timer_suspend_cyc; +static u64 arch_timer_sched_clock_offset;unsigned long long notrace arch_timer_sched_clock (void ) { -return arch_timer_read_counter () * sched_clock_mult; +u64 cyc =arch_timer_read_counter () - arch_timer_sched_clock_offset; +return cyc * sched_clock_mult; }unsigned long long sched_clock (void ) \ __attribute__((weak,alias ("arch_timer_sched_clock" ))); +static int arch_timer_suspend (void ) +{ + arch_timer_suspend_cyc =arch_timer_read_counter (); +return 0 ; +} + +static void arch_timer_resume (void ) +{ + arch_timer_sched_clock_offset += +arch_timer_read_counter () - arch_timer_suspend_cyc; +} + +static struct syscore_ops arch_timer_ops = { + .suspend = arch_timer_suspend, + .resume = arch_timer_resume, +}; +static int __init arch_timer_register (void ) {int err;
@@ -332,6 +353,9 @@ static int __init arch_timer_register(void)pr_info ("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %lluns\n" , arch_timer_rate /1000 , sched_clock_mult); + arch_timer_sched_clock_offset =arch_timer_read_counter (); +register_syscore_ops (&arch_timer_ops); +return 0 ; out_free_irq:
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] clocksource: arm_arch_timer: add boot and suspend sched_clock offset
Quoted 8 lines · Rob Herring
From: Rob Herring <[email protected]>
Commit 023796b (ARM:
arch_timer: use full 64-bit counter forsched_clock) fails to ensuresched_clockalways starts at time 0 and counting is suspended during suspend. arm64sched_clocksupport also has the same issues. This fixes all architected timer users by maintaining an initial offset which is updated on resume.
Quoted 7 lines
Signed-off-by Rob Herring <[email protected]>Cc Russell King <[email protected]>Cc John Stultz <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Stephen Boyd <[email protected]>
For arm64:
Quoted 6 lines · Rob Herring
drivers/clocksource/arm_arch_timer.c +0
-0@@ -266,6 +266,15 @@ static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { .notifier_call = arch_timer_cpu_notify,
drivers/clocksource/arm_arch_timer.c static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { · line 276
Quoted 10 lines
drivers/clocksource/arm_arch_timer.c +8
-0}; +static u64 sched_clock_mult__read_mostly ; + +unsigned long long notrace arch_timer_sched_clock (void ) +{ +return arch_timer_read_counter () * sched_clock_mult; +} +unsigned long long sched_clock (void ) \ + __attribute__((weak,alias ("arch_timer_sched_clock" )));
I'm still lost, how does this prevent the timer in ARM's 32 bit sched_clock code from getting setup in sched_clock_postinit()? That print is still there right? Who owns sched_clock() in multi-target builds?
Why can't we play along with the sched_clock code that lives in arm? Maybe we should resurrect those clocksource sched_clock patches again. Or maybe we should add support for setup_sched_clock_64() in arm's sched clock code.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 9 lines · Stephen Boyd
Quoted 8 lines · Rob Herring
drivers/clocksource/arm_arch_timer.c +0
-0@@ -266,6 +266,15 @@ static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { .notifier_call = arch_timer_cpu_notify, };
Quoted 12 lines
drivers/clocksource/arm_arch_timer.c static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { · line 276
Quoted 8 lines
drivers/clocksource/arm_arch_timer.c +8
-0+static u64 sched_clock_mult__read_mostly ; + +unsigned long long notrace arch_timer_sched_clock (void ) +{ +return arch_timer_read_counter () * sched_clock_mult; +} +unsigned long long sched_clock (void ) \ + __attribute__((weak,alias ("arch_timer_sched_clock" )));I'm still lost, how does this prevent the timer in ARM's 32 bit
sched_clockcode from getting setup insched_clock_postinit()? That print is still there right? Who ownssched_clock()in multi-target builds?
For arm64, it does not define sched_clock, so it will get arch_timer_sched_clock.
For arm, sched_clock is defined in arch/arm/kernel/sched_clock.c and the weak alias is not used. The arm sched_clock function just calls a function pointer which defaults to sched_clock_32 (which is the original arm sched_clock implementation). If the arch timer is present, then the function pointer is set to arch_timer_sched_clock and any calls to setup_sched_clock and the sched_clock_postinit have no effect. Otherwise, the functionality is basically unchanged for <=32-bit sched_clock implementations.
Quoted 4 lines
Why can't we play along with the
sched_clockcode that lives in arm? Maybe we should resurrect those clocksourcesched_clockpatches again. Or maybe we should add support forsetup_sched_clock_64()in arm's sched clock code.
That's what I originally had which Russell objected to. The needs for the arch timer is a bit different since we don't need to deal with wrapping. And we need the same boot time offset and suspend handling in both arm and arm64.
Rob
Quoted 10 lines · Rob Herring
Quoted 9 lines · Stephen Boyd
Quoted 8 lines · Rob Herring
drivers/clocksource/arm_arch_timer.c +0
-0@@ -266,6 +266,15 @@ static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { .notifier_call = arch_timer_cpu_notify, };
Quoted 11 lines
Quoted 11 lines
drivers/clocksource/arm_arch_timer.c static struct notifier_block arch_timer_cpu_nb __cpuinitdata = { · line 276
Quoted 8 lines
drivers/clocksource/arm_arch_timer.c +8
-0+static u64 sched_clock_mult__read_mostly ; + +unsigned long long notrace arch_timer_sched_clock (void ) +{ +return arch_timer_read_counter () * sched_clock_mult; +} +unsigned long long sched_clock (void ) \ + __attribute__((weak,alias ("arch_timer_sched_clock" )));I'm still lost, how does this prevent the timer in ARM's 32 bit
sched_clockcode from getting setup insched_clock_postinit()? That print is still there right?
I still see this:
[ 0.000000] sched_clock: ARM arch timer >56 bits at 19200kHz, resolution 52ns [ 0.000000] Architected cp15 timer running at 19.20MHz (virt). [ 0.000000] Switching to timer-based delay loop [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns,
wraps every 4294967286ms
Quoted 4 lines
Quoted 1 line
Who owns
sched_clock()in multi-target builds?For arm64, it does not define
sched_clock, so it will getarch_timer_sched_clock.
Quoted 8 lines
For arm,
sched_clockis defined inarch/arm/kernel/sched_clock.cand the weak alias is not used. The armsched_clockfunction just calls a function pointer which defaults tosched_clock_32(which is the original armsched_clockimplementation). If the arch timer is present, then the function pointer is set toarch_timer_sched_clockand any calls tosetup_sched_clockand thesched_clock_postinithave no effect. Otherwise, the functionality is basically unchanged for <=32-bitsched_clockimplementations.
Ok. I was missing the part where the function pointer is assigned.
Quoted 10 lines
Quoted 5 lines
Why can't we play along with the
sched_clockcode that lives in arm? Maybe we should resurrect those clocksourcesched_clockpatches again. Or maybe we should add support forsetup_sched_clock_64()in arm's sched clock code.That's what I originally had which Russell objected to. The needs for the arch timer is a bit different since we don't need to deal with wrapping. And we need the same boot time offset and suspend handling in both arm and arm64.
I would much rather we play along with arm's sched_clock code. If we can add support for 64 bits alongside the 32 bit stuff in the same file we should be able to generalize the entire code to generic kernel code and use it on even more arches. I'll try to put something together today.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
cover ARM 64 bit sched_clock take #2
In reply to Rob HerringThis is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
First two patches should probably go in even if the 64 bit stuff doesn't go in at the same time.
Stephen Boyd (4):
ARM: sched_clock: Remove unused needs_suspend member
ARM: sched_clock: Return suspended count earlier
ARM: sched_clock: Add support for >32 bit sched_clock
ARM: arch_timer: Move to setup_sched_clock_64()
arch/arm/include/asm/sched_clock.h | 5 +- arch/arm/kernel/arch_timer.c | 14 +---- arch/arm/kernel/sched_clock.c | 111 ++++++++++++++++++++++++++----------- 3 files changed, 84 insertions(+), 46 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 1/4 ARM: sched_clock: Remove unused needs_suspend member
The needs_suspend member is unused now that we always do the suspend/resume handling (see 6a4dae5 (ARM: 7565/1: sched: stop sched_clock() during suspend, 2012-10-23)).
--- arch/arm/kernel/sched_clock.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/kernel/sched_clock.c +0 -1
@@ -24,7 +24,6 @@ struct clock_data {u32 mult;u32 shift;bool suspended; -bool needs_suspend; };static void sched_clock_poll (unsigned long wrap_ticks);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 2/4 ARM: sched_clock: Return suspended count earlier
In reply to Stephen BoydIf we're suspended and sched_clock() is called we're going to read the hardware one more time and throw away that value and return back the cached value we saved during the suspend callback. This is wasteful, let's short circuit all that and return the cached value if we're suspended as early as possible.
--- arch/arm/kernel/sched_clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/kernel/sched_clock.c +3 -3
@@ -55,9 +55,6 @@ static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)u64 epoch_ns;u32 epoch_cyc; -if (cd.suspended) -return cd.epoch_ns; -/* * Load the epoch_cyc and epoch_ns atomically. We do this by * ensuring that we always write epoch_cyc, epoch_ns and
@@ -174,6 +171,9 @@ unsigned long long __read_mostly (*sched_clock_func)(void) = sched_clock_32;unsigned long long notrace sched_clock (void ) { +if (cd.suspended) +return cd.epoch_ns; +return sched_clock_func (); }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 3/4 ARM: sched_clock: Add support for >32 bit sched_clock
In reply to Stephen BoydThe arm architected system counter has at least 56 bits of useable bits. Add support to ARM's sched_clock implementation for counters with more than 32 bits so we can avoid the complexity of dealing with wraparound on these devices while benefiting from the irqtime accounting and suspend/resume handling that the ARM sched_clock code already has.
---
Maybe we need a union for the epoch_ns usage?
arch/arm/include/asm/sched_clock.h | 2 + arch/arm/kernel/sched_clock.c | 101 +++++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 26 deletions(-)
arch/arm/include/asm/sched_clock.h +2 -0
@@ -13,4 +13,6 @@ extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);extern unsigned long long (*sched_clock_func)(void ); +extern void setup_sched_clock_64 (u64 (*read)(void ),int bits, +unsigned long rate);#endif
arch/arm/kernel/sched_clock.c +75 -26
157 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 3/4] ARM: sched_clock: Add support for >32 bit sched_clock
Hi Stephen,
Quoted 21 lines · Stephen Boyd
The arm architected system counter has at least 56 bits of useable bits. Add support to ARM's
sched_clockimplementation for counters with more than 32 bits so we can avoid the complexity of dealing with wraparound on these devices while benefiting from the irqtime accounting and suspend/resume handling that the ARMsched_clockcode already has.Signed-off-by Stephen Boyd <[email protected]>---
Maybe we need a union for the
epoch_nsusage?arch/arm/include/asm/sched_clock.h | 2 + arch/arm/kernel/sched_clock.c | 101 +++++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 26 deletions(-)arch/arm/include/asm/sched_clock.h +0
-0
arch/arm/include/asm/sched_clock.h extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); · line 17
Quoted 5 lines
arch/arm/include/asm/sched_clock.h +2
-0@@ -13,4 +13,6 @@ extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);extern unsigned long long (*sched_clock_func)(void ); +extern void setup_sched_clock_64 (u64 (*read)(void ),int bits, +unsigned long rate);
Curious, but why do we need two setup_sched_clock functions, where the bits are passed as a parameter? Can't we just do the right thing if the clock claims to be more than 32 bits wide (and get rid of the BUG_ONs at the same time)?
Will
Re: [PATCH 3/4] ARM: sched_clock: Add support for >32 bit sched_clock
Quoted 25 lines · Will Deacon
Hi Stephen,
Quoted 22 lines · Stephen Boyd
The arm architected system counter has at least 56 bits of useable bits. Add support to ARM's
sched_clockimplementation for counters with more than 32 bits so we can avoid the complexity of dealing with wraparound on these devices while benefiting from the irqtime accounting and suspend/resume handling that the ARMsched_clockcode already has.Signed-off-by Stephen Boyd <[email protected]>---
Maybe we need a union for the
epoch_nsusage?arch/arm/include/asm/sched_clock.h | 2 + arch/arm/kernel/sched_clock.c | 101 +++++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 26 deletions(-)arch/arm/include/asm/sched_clock.h +0
-0@@ -13,4 +13,6 @@ extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
Quoted 8 lines
arch/arm/include/asm/sched_clock.h extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); · line 17
Quoted 4 lines
arch/arm/include/asm/sched_clock.h +2
-0extern unsigned long long (*sched_clock_func)(void ); +extern void setup_sched_clock_64 (u64 (*read)(void ),int bits, +unsigned long rate);Curious, but why do we need two
setup_sched_clockfunctions, where the bits are passed as a parameter? Can't we just do the right thing if the clock claims to be more than 32 bits wide (and get rid of theBUG_ONsat the same time)?
This is to avoid having to change a bunch of code that is using setup_sched_clock() already where their read function returns a u32 instead of a u64. I suppose we could make the 64 bit version fall back to the 32 bit version if the bits aren't large enough and provide some sort of u32 wrapper function around the u64 callback. It may also be useful if we can determine that the timer wraps too quickly even when there are more than 32 bits.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH 4/4 ARM: arch_timer: Move to setup_sched_clock_64()
In reply to Stephen BoydRegister with the ARM sched_clock framework now that it supports 64 bits. This also fixes two problems with the current sched_clock support for machines using the archited timers. First off, we don't subtract the start value from subsequent sched_clock calls so we can potentially start off with sched_clock returning gigantic numbers. Second, there is no support for suspend/resume handling so problems such as discussed in 6a4dae5 (ARM: 7565/1:
sched: stop sched_clock() during suspend, 2012-10-23) can happen.
--- arch/arm/include/asm/sched_clock.h | 3 --- arch/arm/kernel/arch_timer.c | 14 ++------------ arch/arm/kernel/sched_clock.c | 3 ++- 3 files changed, 4 insertions(+), 16 deletions(-)
arch/arm/include/asm/sched_clock.h +0 -3
@@ -10,9 +10,6 @@extern void sched_clock_postinit (void );extern void setup_sched_clock (u32 (*read)(void ),int bits,unsigned long rate); - -extern unsigned long long (*sched_clock_func)(void ); -extern void setup_sched_clock_64 (u64 (*read)(void ),int bits,unsigned long rate);#endif
arch/arm/kernel/arch_timer.c +2 -12
@@ -22,13 +22,6 @@ static unsigned long arch_timer_read_counter_long(void)return arch_timer_read_counter (); } -static u32 sched_clock_mult__read_mostly ; - -static unsigned long long notrace arch_timer_sched_clock (void ) -{ -return arch_timer_read_counter () * sched_clock_mult; -} -static struct delay_timer arch_delay_timer;static void __init arch_timer_delay_timer_register (void )
@@ -48,11 +41,8 @@ int __init arch_timer_arch_init(void)arch_timer_delay_timer_register (); -/* Cache the sched_clock multiplier to save a divide in the hot path. */ - sched_clock_mult =NSEC_PER_SEC / arch_timer_rate; - sched_clock_func = arch_timer_sched_clock; -pr_info ("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n" , - arch_timer_rate /1000 , sched_clock_mult); +/* 56 bits minimum, so we assume worst case rollover */ +setup_sched_clock_64 (arch_timer_read_counter,56 , arch_timer_rate);return 0 ; }
arch/arm/kernel/sched_clock.c +2 -1
@@ -181,7 +181,8 @@ static unsigned long long notrace sched_clock_32(void)return cyc_to_sched_clock (cyc, sched_clock_mask); } -unsigned long long __read_mostly (*sched_clock_func)(void ) = sched_clock_32; +static unsigned long long __read_mostly +(*sched_clock_func)(void ) = sched_clock_32;static unsigned long long notrace sched_clock_64 (void ) {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 0/4] ARM 64 bit sched_clock take #2
In reply to Stephen BoydQuoted 3 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
I don't have enough background to review the patches, but I know that you can find an arm64 compiler in Ubuntu Raring. If you are running that on one of your sysstems, just 'apt-get install gcc-aarch64-linux-gnu'.
Arnd
Mark Rutland
maintainerRe: [PATCH 0/4] ARM 64 bit sched_clock take #2
In reply to Stephen BoydHi Stephen,
Quoted 13 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
First two patches should probably go in even if the 64 bit stuff doesn't go in at the same time.
Stephen Boyd (4):
ARM:sched_clock: Remove unusedneeds_suspendmember
ARM:sched_clock: Return suspended count earlier
ARM:sched_clock: Add support for >32 bitsched_clock
ARM:arch_timer: Move tosetup_sched_clock_64()
Quoted 4 lines
arch/arm/include/asm/sched_clock.h | 5 +- arch/arm/kernel/arch_timer.c | 14 +---- arch/arm/kernel/sched_clock.c | 111 ++++++++++++++++++++++++++----------- 3 files changed, 84 insertions(+), 46 deletions(-)
I wanted to look at the series with more context, but I don't seem to be able to apply patch 2 and beyond to my tree, and I couldn't figure out what tree this series was based on.
What do I need to use as the base for this series?
Thanks,
Mark.
Re: [PATCH 0/4] ARM 64 bit sched_clock take #2
Quoted 20 lines · Mark Rutland
Hi Stephen,
Quoted 13 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
First two patches should probably go in even if the 64 bit stuff doesn't go in at the same time.
Stephen Boyd (4):
ARM:sched_clock: Remove unusedneeds_suspendmember
ARM:sched_clock: Return suspended count earlier
ARM:sched_clock: Add support for >32 bitsched_clock
ARM:arch_timer: Move tosetup_sched_clock_64()Quoted 4 lines
arch/arm/include/asm/sched_clock.h | 5 +- arch/arm/kernel/arch_timer.c | 14 +---- arch/arm/kernel/sched_clock.c | 111 ++++++++++++++++++++++++++----------- 3 files changed, 84 insertions(+), 46 deletions(-)
Quoted 5 lines
I wanted to look at the series with more context, but I don't seem to be able to apply patch 2 and beyond to my tree, and I couldn't figure out what tree this series was based on.
What do I need to use as the base for this series?
These are based on next-20130419.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Mark Rutland
maintainerRe: [PATCH 0/4] ARM 64 bit sched_clock take #2
Quoted 21 lines · Stephen Boyd
Quoted 20 lines · Mark Rutland
Hi Stephen,
Quoted 17 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
First two patches should probably go in even if the 64 bit stuff doesn't go in at the same time.
Stephen Boyd (4):
ARM:sched_clock: Remove unusedneeds_suspendmember
ARM:sched_clock: Return suspended count earlier
ARM:sched_clock: Add support for >32 bitsched_clock
ARM:arch_timer: Move tosetup_sched_clock_64()arch/arm/include/asm/sched_clock.h | 5 +- arch/arm/kernel/arch_timer.c | 14 +---- arch/arm/kernel/sched_clock.c | 111 ++++++++++++++++++++++++++----------- 3 files changed, 84 insertions(+), 46 deletions(-)
Quoted 7 lines
Quoted 5 lines
I wanted to look at the series with more context, but I don't seem to be able to apply patch 2 and beyond to my tree, and I couldn't figure out what tree this series was based on.
What do I need to use as the base for this series?
These are based on next-20130419.
Cheers!
Mark.
Re: [PATCH 0/4] ARM 64 bit sched_clock take #2
In reply to Stephen BoydQuoted 2 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64 compiler.
I think moving this to generic code sounds like a good idea. You could probably also prototype and test the 64bit code with x86_64, using the TSC counter.
thanks
-john
Re: [PATCH 0/4] ARM 64 bit sched_clock take #2
Quoted 9 lines · John Stultz
Quoted 4 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64
compiler.I think moving this to generic code sounds like a good idea. You could probably also prototype and test the 64bit code with
x86_64, using the TSC counter.
I agree this should all be common, but I'd like to see the common version first. That is not going to make it for 3.10. For 3.10, the immediate need is to fix suspend and initial time for the arch timer. I think this should be fixed locally in arch timer code for 3.10. The alternative is to revert linux-next commit 023796b9be3a77481cd5 (ARM:arch_timer: use full 64-bit counter for sched_clock) which will cause the arch timer to not be used as sched_clock if another higher frequency sched_clock is registered.
Rob
Re: [PATCH 0/4] ARM 64 bit sched_clock take #2
Quoted 9 lines · Rob Herring
Quoted 8 lines · John Stultz
Quoted 4 lines · Stephen Boyd
This is what I was thinking. I don't see why we can't move this to generic code and have arm64 use it too. Those patches will follow once I find an arm64
compiler.I think moving this to generic code sounds like a good idea. You could probably also prototype and test the 64bit code with
x86_64, using the TSC counter.
Quoted 8 lines
I agree this should all be common, but I'd like to see the common version first. That is not going to make it for 3.10. For 3.10, the immediate need is to fix suspend and initial time for the arch timer. I think this should be fixed locally in arch timer code for 3.10. The alternative is to revert linux-next commit
023796b9be3a77481cd5(ARM:arch_timer: use full 64-bit counter forsched_clock) which will cause the arch timer to not be used assched_clockif another higher frequencysched_clockis registered.
This would make sense to me if we were already in the 3.10-rc1 or rc2 phase, but this code isn't even in Linus' tree yet. Why can't we just fix it properly before sending off to Linus? Obviously this is up to the maintainers to decide, so if we can't fix it properly with this patch series I propose we revert like you say.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
[PATCH 5/4] sched: Make ARM's sched_clock generic for all architectures
In reply to Stephen BoydHere's the patch to make sched_clock generic. I didn't know where to put it so I just made a new file in kernel/sched for now.
---
arch/arm/Kconfig | 1 +
arch/arm/common/timer-sp.c | 2 +-
arch/arm/kernel/Makefile | 2 +-
arch/arm/kernel/arch_timer.c | 2 +-
arch/arm/kernel/time.c | 4 +---
arch/arm/mach-davinci/time.c | 2 +-
arch/arm/mach-imx/time.c | 2 +-
arch/arm/mach-integrator/integrator_ap.c | 2 +-
arch/arm/mach-ixp4xx/common.c | 2 +-
arch/arm/mach-mmp/time.c | 2 +-
arch/arm/mach-msm/timer.c | 2 +-
arch/arm/mach-omap1/time.c | 2 +-
arch/arm/mach-omap2/timer.c | 2 +-
arch/arm/mach-pxa/time.c | 2 +-
arch/arm/mach-sa1100/time.c | 2 +-
arch/arm/mach-u300/timer.c | 2 +-
arch/arm/plat-iop/time.c | 2 +-
arch/arm/plat-omap/counter_32k.c | 2 +-
arch/arm/plat-orion/time.c | 2 +-
arch/arm/plat-samsung/samsung-time.c | 2 +-
arch/arm/plat-versatile/sched-clock.c | 2 +-
drivers/clocksource/bcm2835_timer.c | 2 +-
drivers/clocksource/clksrc-dbx500-prcmu.c | 3 +--
drivers/clocksource/dw_apb_timer_of.c | 2 +-
drivers/clocksource/mxs_timer.c | 2 +-
drivers/clocksource/nomadik-mtu.c | 2 +-
drivers/clocksource/tegra20_timer.c | 2 +-
drivers/clocksource/time-armada-370-xp.c | 2 +-
drivers/clocksource/timer-marco.c | 2 +-
drivers/clocksource/timer-prima2.c | 2 +-
{arch/arm/include/asm => include/linux}/sched_clock.h | 9 +++++++--
init/Kconfig | 3 +++
init/main.c | 2 ++
kernel/sched/Makefile | 1 +
{arch/arm/kernel => kernel/sched}/sched_clock.c | 3 +--
35 files changed, 44 insertions(+), 36 deletions(-)
rename {arch/arm/include/asm => include/linux}/sched_clock.h (76%)
rename {arch/arm/kernel => kernel/sched}/sched_clock.c (99%)arch/arm/Kconfig +1 -0
@@ -14,6 +14,7 @@ config ARM select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW select GENERIC_PCI_IOMAP + select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select GENERIC_IDLE_LOOP select GENERIC_IDLE_POLL_SETUP
arch/arm/common/timer-sp.c +1 -1
@@ -28,8 +28,8 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <asm/hardware/arm_timer.h> #include <asm/hardware/timer-sp.h>
arch/arm/kernel/Makefile +1 -1
@@ -16,7 +16,7 @@ CFLAGS_REMOVE_return_address.o = -pg # Object file lists. obj-y := elf.o entry-common.o irq.o opcodes.o \ - process.o ptrace.o return_address.o sched_clock.o \ + process.o ptrace.o return_address.o \ setup.o signal.o stacktrace.o sys_arm.o time.o traps.o obj-$(CONFIG_ATAGS) += atags_parse.o
arch/arm/kernel/arch_timer.c +1 -1
@@ -11,9 +11,9 @@#include <linux/init.h> #include <linux/types.h> #include <linux/errno.h> +#include <linux/sched_clock.h> #include <asm/delay.h> -#include <asm/sched_clock.h> #include <clocksource/arm_arch_timer.h>
arch/arm/kernel/time.c +1 -3
@@ -24,9 +24,9 @@#include <linux/timer.h> #include <linux/clocksource.h> #include <linux/irq.h> +#include <linux/sched_clock.h> #include <asm/thread_info.h> -#include <asm/sched_clock.h> #include <asm/stacktrace.h> #include <asm/mach/arch.h> #include <asm/mach/time.h>
@@ -120,6 +120,4 @@ void __init time_init(void) machine_desc->init_time (); elseclocksource_of_init (); - -sched_clock_postinit (); }
arch/arm/mach-davinci/time.c +1 -1
@@ -18,8 +18,8 @@#include <linux/clk.h> #include <linux/err.h> #include <linux/platform_device.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <asm/mach/irq.h> #include <asm/mach/time.h>
arch/arm/mach-imx/time.c +1 -1
@@ -26,8 +26,8 @@#include <linux/clockchips.h> #include <linux/clk.h> #include <linux/err.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <asm/mach/time.h> #include "common.h"
arch/arm/mach-integrator/integrator_ap.c +1 -1
@@ -41,6 +41,7 @@#include <linux/stat.h> #include <linux/sys_soc.h> #include <linux/termios.h> +#include <linux/sched_clock.h> #include <video/vga.h> #include <mach/hardware.h>
@@ -49,7 +50,6 @@#include <asm/setup.h> #include <asm/param.h> /* HZ */ #include <asm/mach-types.h> -#include <asm/sched_clock.h> #include <mach/lm.h> #include <mach/irqs.h>
arch/arm/mach-ixp4xx/common.c +1 -1
@@ -30,6 +30,7 @@#include <linux/export.h> #include <linux/gpio.h> #include <linux/cpu.h> +#include <linux/sched_clock.h> #include <mach/udc.h> #include <mach/hardware.h>
@@ -38,7 +39,6 @@#include <asm/pgtable.h> #include <asm/page.h> #include <asm/irq.h> -#include <asm/sched_clock.h> #include <asm/system_misc.h> #include <asm/mach/map.h>
arch/arm/mach-mmp/time.c +1 -1
@@ -28,8 +28,8 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <mach/addr-map.h> #include <mach/regs-timers.h> #include <mach/regs-apbc.h>
arch/arm/mach-msm/timer.c +1 -1
@@ -23,10 +23,10 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> #include <asm/localtimer.h> -#include <asm/sched_clock.h> #include "common.h"
arch/arm/mach-omap1/time.c +1 -1
@@ -43,9 +43,9 @@#include <linux/clocksource.h> #include <linux/clockchips.h> #include <linux/io.h> +#include <linux/sched_clock.h> #include <asm/irq.h> -#include <asm/sched_clock.h> #include <mach/hardware.h> #include <asm/mach/irq.h>
arch/arm/mach-omap2/timer.c +1 -1
@@ -41,10 +41,10 @@#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/platform_data/dmtimer-omap.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> #include <asm/smp_twd.h> -#include <asm/sched_clock.h> #include "omap_hwmod.h" #include "omap_device.h"
arch/arm/mach-pxa/time.c +1 -1
@@ -16,11 +16,11 @@#include <linux/init.h> #include <linux/interrupt.h> #include <linux/clockchips.h> +#include <linux/sched_clock.h> #include <asm/div64.h> #include <asm/mach/irq.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> #include <mach/regs-ost.h> #include <mach/irqs.h>
arch/arm/mach-sa1100/time.c +1 -1
@@ -14,9 +14,9 @@#include <linux/irq.h> #include <linux/timex.h> #include <linux/clockchips.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> #include <mach/hardware.h> #include <mach/irqs.h>
arch/arm/mach-u300/timer.c +1 -1
@@ -18,12 +18,12 @@#include <linux/clk.h> #include <linux/err.h> #include <linux/irq.h> +#include <linux/sched_clock.h> #include <mach/hardware.h> #include <mach/irqs.h> /* Generic stuff */ -#include <asm/sched_clock.h> #include <asm/mach/map.h> #include <asm/mach/time.h>
arch/arm/plat-iop/time.c +1 -1
@@ -22,9 +22,9 @@#include <linux/clocksource.h> #include <linux/clockchips.h> #include <linux/export.h> +#include <linux/sched_clock.h> #include <mach/hardware.h> #include <asm/irq.h> -#include <asm/sched_clock.h> #include <asm/uaccess.h> #include <asm/mach/irq.h> #include <asm/mach/time.h>
arch/arm/plat-omap/counter_32k.c +1 -1
@@ -18,9 +18,9 @@#include <linux/err.h> #include <linux/io.h> #include <linux/clocksource.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> #include <plat/counter-32k.h>
arch/arm/plat-orion/time.c +1 -1
@@ -16,7 +16,7 @@#include <linux/clockchips.h> #include <linux/interrupt.h> #include <linux/irq.h> -#include <asm/sched_clock.h> +#include <linux/sched_clock.h> /* * MBus bridge block registers.
arch/arm/plat-samsung/samsung-time.c +1 -1
@@ -15,12 +15,12 @@#include <linux/clk.h> #include <linux/clockchips.h> #include <linux/platform_device.h> +#include <linux/sched_clock.h> #include <asm/smp_twd.h> #include <asm/mach/time.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <asm/sched_clock.h> #include <mach/map.h> #include <plat/devs.h>
arch/arm/plat-versatile/sched-clock.c +1 -1
@@ -20,8 +20,8 @@*/ #include <linux/kernel.h> #include <linux/io.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <plat/sched_clock.h> static void __iomem *ctr;
drivers/clocksource/bcm2835_timer.c +1 -1
@@ -28,8 +28,8 @@#include <linux/of_platform.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <asm/irq.h> #define REG_CONTROL 0x00
drivers/clocksource/clksrc-dbx500-prcmu.c +1 -2
@@ -14,8 +14,7 @@*/ #include <linux/clockchips.h> #include <linux/clksrc-dbx500-prcmu.h> - -#include <asm/sched_clock.h> +#include <linux/sched_clock.h> #define RATE_32K 32768
drivers/clocksource/dw_apb_timer_of.c +1 -1
@@ -20,9 +20,9 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> static void timer_get_base_and_rate (struct device_node *np,void __iomem **base,u32 *rate)
drivers/clocksource/mxs_timer.c +1 -1
@@ -29,9 +29,9 @@#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/stmp_device.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> /* * There are 2 versions of the timrot on Freescale MXS-based SoCs.
drivers/clocksource/nomadik-mtu.c +1 -1
@@ -18,8 +18,8 @@#include <linux/delay.h> #include <linux/err.h> #include <linux/platform_data/clocksource-nomadik-mtu.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> -#include <asm/sched_clock.h> /* * The MTU device hosts four different counters, with 4 set of
drivers/clocksource/tegra20_timer.c +1 -1
@@ -26,10 +26,10 @@#include <linux/io.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> #include <asm/smp_twd.h> -#include <asm/sched_clock.h> #define RTC_SECONDS 0x08#define RTC_SHADOW_SECONDS 0x0c
drivers/clocksource/time-armada-370-xp.c +1 -1
@@ -27,8 +27,8 @@#include <linux/of_address.h> #include <linux/irq.h> #include <linux/module.h> +#include <linux/sched_clock.h> -#include <asm/sched_clock.h> #include <asm/localtimer.h> #include <linux/percpu.h> /*
drivers/clocksource/timer-marco.c +1 -1
@@ -17,7 +17,7 @@#include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_address.h> -#include <asm/sched_clock.h> +#include <linux/sched_clock.h> #include <asm/localtimer.h> #include <asm/mach/time.h>
drivers/clocksource/timer-prima2.c +1 -1
@@ -18,7 +18,7 @@#include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_address.h> -#include <asm/sched_clock.h> +#include <linux/sched_clock.h> #include <asm/mach/time.h> #define SIRFSOC_TIMER_COUNTER_LO 0x0000
include/linux/sched_clock.h renamed from arch/arm/include/asm/sched_clock.h +7 -2
@@ -5,10 +5,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef ASM_SCHED_CLOCK -#define ASM_SCHED_CLOCK +#ifndef LINUX_SCHED_CLOCK +#define LINUX_SCHED_CLOCK +#ifdef CONFIG_GENERIC_SCHED_CLOCK extern void sched_clock_postinit (void ); +#else +static inline void sched_clock_postinit (void ) { } +#endif +extern void setup_sched_clock (u32 (*read)(void ),int bits,unsigned long rate);extern void setup_sched_clock_64 (u64 (*read)(void ),int bits,unsigned long rate);
init/Kconfig +3 -0
@@ -772,6 +772,9 @@ config LOG_BUF_SHIFT config HAVE_UNSTABLE_SCHED_CLOCK bool +config GENERIC_SCHED_CLOCK + bool + # # For architectures that want to enable the support for NUMA-affine scheduler # balancing logic:
init/main.c +2 -0
@@ -72,6 +72,7 @@#include <linux/ptrace.h> #include <linux/blkdev.h> #include <linux/elevator.h> +#include <linux/sched_clock.h> #include <asm/io.h> #include <asm/bugs.h>
@@ -552,6 +553,7 @@ asmlinkage void __init start_kernel(void)softirq_init ();timekeeping_init ();time_init (); +sched_clock_postinit ();profile_init ();call_function_init ();WARN (!irqs_disabled (),"Interrupts were enabled early\n" );
kernel/sched/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o obj-$(CONFIG_SCHEDSTATS) += stats.o obj-$(CONFIG_SCHED_DEBUG) += debug.o obj-$(CONFIG_CGROUP_CPUACCT) += cpuacct.o +obj-$(CONFIG_GENERIC_SCHED_CLOCK) += sched_clock.o
kernel/sched/sched_clock.c renamed from arch/arm/kernel/sched_clock.c +1 -2
@@ -13,8 +13,7 @@#include <linux/sched.h> #include <linux/syscore_ops.h> #include <linux/timer.h> - -#include <asm/sched_clock.h> +#include <linux/sched_clock.h> struct clock_data {u64 epoch_ns;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
[PATCH 6/4] arm64: Move to generic sched_clock infrastructure
Use the generic sched_clock infrastructure instead of rolling our own. This has the added benefit of fixing suspend/resume as outlined in 6a4dae5 (ARM: 7565/1: sched: stop sched_clock() during suspend, 2012-10-23) and correcting the timestamps when the hardware returns a value instead of 0 upon the first read.
--- arch/arm64/Kconfig | 1 + arch/arm64/kernel/time.c | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm64/Kconfig +1 -0
@@ -13,6 +13,7 @@ config ARM64 select GENERIC_IOMAP select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW + select GENERIC_SCHED_CLOCK select GENERIC_SMP_IDLE_THREAD select GENERIC_TIME_VSYSCALL select HARDIRQS_SW_RESEND
arch/arm64/kernel/time.c +2 -9
@@ -33,6 +33,7 @@#include <linux/irq.h> #include <linux/delay.h> #include <linux/clocksource.h> +#include <linux/sched_clock.h> #include <clocksource/arm_arch_timer.h>
@@ -61,13 +62,6 @@ unsigned long profile_pc(struct pt_regs *regs)EXPORT_SYMBOL (profile_pc);#endif -static u64 sched_clock_mult__read_mostly ; - -unsigned long long notrace sched_clock (void ) -{ -return arch_timer_read_counter () * sched_clock_mult; -} -int read_current_timer (unsigned long *timer_value) { *timer_value =arch_timer_read_counter ();
@@ -84,8 +78,7 @@ void __init time_init(void)if (!arch_timer_rate)panic ("Unable to initialise architected timer.\n" ); -/* Cache the sched_clock multiplier to save a divide in the hot path. */ - sched_clock_mult =NSEC_PER_SEC / arch_timer_rate; +setup_sched_clock_64 (arch_timer_read_counter,56 , arch_timer_rate);/* Calibrate the delay loop directly */ lpj_fine = arch_timer_rate /HZ ;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 6/4] arm64: Move to generic sched_clock infrastructure
Quoted 7 lines · Stephen Boyd
Use the generic
sched_clockinfrastructure instead of rolling our own. This has the added benefit of fixing suspend/resume as outlined in 6a4dae5 (ARM: 7565/1: sched: stopsched_clock()during suspend, 2012-10-23) and correcting the timestamps when the hardware returns a value instead of 0 upon the first read.Signed-off-by Stephen Boyd <[email protected]>
Looks ok.
Christopher Covington
Tested-byRe: [PATCH 6/4] arm64: Move to generic sched_clock infrastructure
Quoted 7 lines · Catalin Marinas
Quoted 6 lines · Stephen Boyd
Use the generic
sched_clockinfrastructure instead of rolling our own. This has the added benefit of fixing suspend/resume as outlined in 6a4dae5 (ARM: 7565/1: sched: stopsched_clock()during suspend, 2012-10-23) and correcting the timestamps when the hardware returns a value instead of 0 upon the first read.
Quoted 5 lines
Quoted 1 line
Signed-off-by Stephen Boyd <[email protected]>Looks ok.
Acked-by Catalin Marinas <[email protected]>
I built and ran this change and dependencies on top of Catalin's soc-armv8-model branch [1] and was able to verify that it fixed the printk timestamp jump.
1.
http://git.kernel.org/cgit/linux/kernel/git/cmarinas/linux-aarch64.git/log/?h=soc-armv8-model
Signature · 3 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation.
Re: [PATCH 5/4] sched: Make ARM's sched_clock generic for all architectures
In reply to Stephen BoydQuoted 5 lines · Stephen Boyd
Here's the patch to make
sched_clockgeneric. I didn't know where to put it so I just made a new file in kernel/sched for now.Signed-off-by Stephen Boyd <[email protected]>
Hey Stephen,
Baruch just asked a question about moving arm's sched_clock.c to be
generic, and it sounded familiar, so I dug around and found this mail from a few months ago.
Just wanted to follow up and see what the status is with this? Is this queued somewhere already?
thanks
-john
Re: [PATCH 5/4] sched: Make ARM's sched_clock generic for all architectures
Quoted 7 lines · John Stultz
Quoted 5 lines · Stephen Boyd
Here's the patch to make
sched_clockgeneric. I didn't know where to put it so I just made a new file in kernel/sched for now.Signed-off-by Stephen Boyd <[email protected]>
Quoted 8 lines
Hey Stephen,
Baruch just asked a question about moving arm'ssched_clock.cto
be generic, and it sounded familiar, so I dug around and found this mail from a few months ago.Just wanted to follow up and see what the status is with this? Is this queued somewhere already?
As far as I know nothing has been queued. I refreshed the patchset against 3.10-rc2 but haven't sent it out since it wasn't clear if anyone wanted it. Shall I send it again?
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 5/4] sched: Make ARM's sched_clock generic for all architectures
Quoted 12 lines · Stephen Boyd
Quoted 11 lines · John Stultz
Quoted 5 lines · Stephen Boyd
Here's the patch to make
sched_clockgeneric. I didn't know where to put it so I just made a new file in kernel/sched for now.Signed-off-by Stephen Boyd <[email protected]>Hey Stephen,
Baruch just asked a question about moving arm'ssched_clock.cto
be generic, and it sounded familiar, so I dug around and found this mail from a few months ago.
Quoted 6 lines
Quoted 3 lines
Just wanted to follow up and see what the status is with this? Is this queued somewhere already?
As far as I know nothing has been queued. I refreshed the patchset against 3.10-rc2 but haven't sent it out since it wasn't clear if anyone wanted it. Shall I send it again?
Please. Even if it need an eventual deeper rework to be totally generic, I think we need to start moving things in that generic direction. Baruch's case is a clear example where non-arm code could share it, so I think that's at least a good proof point that sharing is actually needed (rather then just for theoretical reasons).
thanks
-john
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
In preparation to fix initial time and suspend/resume handling, unify the
sched_clockinit and implementation for arch timer on arm and arm64.
Quoted 7 lines
Signed-off-by Rob Herring <[email protected]>Cc Russell King <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc John Stultz <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Stephen Boyd <[email protected]>
For arm64: