[Xenomai-git] Philippe Gerum : cobalt/kernel: distinguish u/k/i latencies in Kconfig
Module: xenomai-3 Branch: master Commit: bc761d8cf25c21944620a2f6f0d67c1b8fce9bed URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc761d8cf25c21944620a2f6f0d67c1b8fce9bed Author: Philippe Gerum Date: Thu Feb 5 13:22:24 2015 +0100 cobalt/kernel: distinguish u/k/i latencies in Kconfig --- kernel/cobalt/Kconfig | 60 +++- .../arch/arm/include/asm/xenomai/calibration.h | 30 +- .../blackfin/include/asm/xenomai/calibration.h | 12 ++-- .../arch/nios2/include/asm/xenomai/calibration.h | 13 ++--- .../arch/powerpc/include/asm/xenomai/calibration.h | 12 ++-- .../arch/sh/include/asm/xenomai/calibration.h | 11 ++-- .../arch/x86/include/asm/xenomai/calibration.h | 18 +++--- kernel/cobalt/clock.c | 10 ++-- 8 files changed, 102 insertions(+), 64 deletions(-) diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig index 2e49d37..9c754f5 100644 --- a/kernel/cobalt/Kconfig +++ b/kernel/cobalt/Kconfig @@ -173,19 +173,6 @@ config XENO_OPT_AUTOTUNE adjusting the core timing services to the intrinsic latency of the platform. -config XENO_OPT_TIMING_SCHEDLAT - int "Scheduling latency (ns)" - default 0 - help - Scheduling latency is the time between the termination of an - interrupt handler and the execution of the first instruction - of the real-time thread this handler resumes. A default value - of 0 (recommended) will cause a pre-calibrated value to be - used. - - If the auto-tuner is enabled, this value will be used as the - factory default when running "autotune --reset". - config XENO_OPT_SCALABLE_SCHED bool "O(1) scheduler" help @@ -344,6 +331,53 @@ config XENO_OPT_DEBUG_TRACE_LOGSZ endmenu +menu "Latency settings" + +config XENO_OPT_TIMING_SCHEDLAT + int "User scheduling latency (ns)" + default 0 + help + The user scheduling latency is the time between the + termination of an interrupt handler and the execution of the + first instruction of the real-time application thread this + handler resumes. A default value of 0 (recommended) will cause + a pre-calibrated value to be used. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +config XENO_OPT_TIMING_KSCHEDLAT + int "Intra-kernel scheduling latency (ns)" + default 0 + help + The intra-kernel scheduling latency is the time between the + termination of an interrupt handler and the execution of the + first instruction of the RTDM kernel thread this handler + resumes. A default value of 0 (recommended) will cause a + pre-calibrated value to be used. + + Intra-kernel latency is usually significantly lower than user + scheduling latency on MMU-enabled platforms, due to CPU cache + latency. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +config XENO_OPT_TIMING_IRQLAT + int "Interrupt latency (ns)" + default 0 + help + + The interrupt latency is the time between the occurrence of an + IRQ and the first instruction of the interrupt handler which + will service it. A default value of 0 (recommended) will cause + a pre-calibrated value to be used. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +endmenu + menuconfig XENO_OPT_DEBUG depends on XENO_OPT_VFILE bool "Debug support" diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h index 6f8f3bf..82ff68d 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h @@ -22,30 +22,34 @@ #ifndef _COBALT_ARM_ASM_CALIBRATION_H #define _COBALT_ARM_ASM_CALIBRATION_H -extern unsigned omap_rev(void); +unsigned int omap_rev(void); #define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44) -static inline unsigned long xnarch_get_sched_latency (void) +static inline void xnarch_get_latencies(struct xnclock_gravity *p) { + unsigned int ulat; #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0 - return CONFIG_XENO_OPT_TIMING_SCHEDLAT; -#else -#if defined(CONFIG_ARCH_AT91RM9200) - return 8500; + ulat = CONFIG_XENO_OPT_TIMING_SCHEDLAT; +#elif defined(CONFIG_ARCH_AT91RM9200) + ulat = 8500; #elif defined(CONFIG_ARCH_AT91SAM9263) - return 11000; + ulat = 11000; +#elif defined(CONFIG_SOC_IMX6Q) + ulat = 6000; #elif defined(CONFIG_ARCH_MX51) - return 5000; + ulat = 5000; #elif defined(CONFIG_ARCH_MX53) - return 5000; + ulat = 5000; #elif defined(CONFIG_ARCH_MX6) - return 2000; +
[Xenomai-git] Philippe Gerum : cobalt/kernel: distinguish u/k/i latencies in Kconfig
Module: xenomai-3 Branch: next Commit: bc761d8cf25c21944620a2f6f0d67c1b8fce9bed URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc761d8cf25c21944620a2f6f0d67c1b8fce9bed Author: Philippe Gerum Date: Thu Feb 5 13:22:24 2015 +0100 cobalt/kernel: distinguish u/k/i latencies in Kconfig --- kernel/cobalt/Kconfig | 60 +++- .../arch/arm/include/asm/xenomai/calibration.h | 30 +- .../blackfin/include/asm/xenomai/calibration.h | 12 ++-- .../arch/nios2/include/asm/xenomai/calibration.h | 13 ++--- .../arch/powerpc/include/asm/xenomai/calibration.h | 12 ++-- .../arch/sh/include/asm/xenomai/calibration.h | 11 ++-- .../arch/x86/include/asm/xenomai/calibration.h | 18 +++--- kernel/cobalt/clock.c | 10 ++-- 8 files changed, 102 insertions(+), 64 deletions(-) diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig index 2e49d37..9c754f5 100644 --- a/kernel/cobalt/Kconfig +++ b/kernel/cobalt/Kconfig @@ -173,19 +173,6 @@ config XENO_OPT_AUTOTUNE adjusting the core timing services to the intrinsic latency of the platform. -config XENO_OPT_TIMING_SCHEDLAT - int "Scheduling latency (ns)" - default 0 - help - Scheduling latency is the time between the termination of an - interrupt handler and the execution of the first instruction - of the real-time thread this handler resumes. A default value - of 0 (recommended) will cause a pre-calibrated value to be - used. - - If the auto-tuner is enabled, this value will be used as the - factory default when running "autotune --reset". - config XENO_OPT_SCALABLE_SCHED bool "O(1) scheduler" help @@ -344,6 +331,53 @@ config XENO_OPT_DEBUG_TRACE_LOGSZ endmenu +menu "Latency settings" + +config XENO_OPT_TIMING_SCHEDLAT + int "User scheduling latency (ns)" + default 0 + help + The user scheduling latency is the time between the + termination of an interrupt handler and the execution of the + first instruction of the real-time application thread this + handler resumes. A default value of 0 (recommended) will cause + a pre-calibrated value to be used. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +config XENO_OPT_TIMING_KSCHEDLAT + int "Intra-kernel scheduling latency (ns)" + default 0 + help + The intra-kernel scheduling latency is the time between the + termination of an interrupt handler and the execution of the + first instruction of the RTDM kernel thread this handler + resumes. A default value of 0 (recommended) will cause a + pre-calibrated value to be used. + + Intra-kernel latency is usually significantly lower than user + scheduling latency on MMU-enabled platforms, due to CPU cache + latency. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +config XENO_OPT_TIMING_IRQLAT + int "Interrupt latency (ns)" + default 0 + help + + The interrupt latency is the time between the occurrence of an + IRQ and the first instruction of the interrupt handler which + will service it. A default value of 0 (recommended) will cause + a pre-calibrated value to be used. + + If the auto-tuner is enabled, this value will be used as the + factory default when running "autotune --reset". + +endmenu + menuconfig XENO_OPT_DEBUG depends on XENO_OPT_VFILE bool "Debug support" diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h index 6f8f3bf..82ff68d 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/calibration.h @@ -22,30 +22,34 @@ #ifndef _COBALT_ARM_ASM_CALIBRATION_H #define _COBALT_ARM_ASM_CALIBRATION_H -extern unsigned omap_rev(void); +unsigned int omap_rev(void); #define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44) -static inline unsigned long xnarch_get_sched_latency (void) +static inline void xnarch_get_latencies(struct xnclock_gravity *p) { + unsigned int ulat; #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0 - return CONFIG_XENO_OPT_TIMING_SCHEDLAT; -#else -#if defined(CONFIG_ARCH_AT91RM9200) - return 8500; + ulat = CONFIG_XENO_OPT_TIMING_SCHEDLAT; +#elif defined(CONFIG_ARCH_AT91RM9200) + ulat = 8500; #elif defined(CONFIG_ARCH_AT91SAM9263) - return 11000; + ulat = 11000; +#elif defined(CONFIG_SOC_IMX6Q) + ulat = 6000; #elif defined(CONFIG_ARCH_MX51) - return 5000; + ulat = 5000; #elif defined(CONFIG_ARCH_MX53) - return 5000; + ulat = 5000; #elif defined(CONFIG_ARCH_MX6) - return 2000; +