Commit 1643c756 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl: shorten, sanitize Kconfig switches


Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent 918504e4
......@@ -291,7 +291,7 @@ config PGTABLE_LEVELS
default 3 if ARM_LPAE
default 2
source "kernel/Kconfig.evenless"
source "kernel/Kconfig.evl"
menu "System Type"
......@@ -570,7 +570,7 @@ config ARCH_MULTI_V6_V7
select MIGHT_HAVE_CACHE_L2X0
select HAVE_IRQ_PIPELINE
select HAVE_DOVETAIL if CPU_HAS_ASID
select HAVE_ARCH_EVENLESS
select HAVE_ARCH_EVL
select WARN_CPUFREQ_GOVERNOR if CPU_FREQ && \
!(CPU_FREQ_DEFAULT_GOV_PERFORMANCE || \
CPU_FREQ_DEFAULT_GOV_POWERSAVE)
......
......@@ -250,7 +250,7 @@ KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
endif
endif
ifeq ($(CONFIG_EVENLESS),y)
ifeq ($(CONFIG_EVL),y)
KBUILD_CFLAGS += -Iarch/$(SRCARCH)/evenless/include -Iinclude/evenless
endif
......
......@@ -152,7 +152,7 @@ config ARM64
select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
select HAVE_ARCH_VMAP_STACK
select HAVE_ARCH_EVENLESS
select HAVE_ARCH_EVL
select HAVE_ARM_SMCCC
select HAVE_ASM_MODVERSIONS
select HAVE_EBPF_JIT
......@@ -1839,7 +1839,7 @@ config STACKPROTECTOR_PER_TASK
endmenu
source "kernel/Kconfig.evenless"
source "kernel/Kconfig.evl"
menu "Boot options"
......
......@@ -131,7 +131,7 @@ endif
CHECKFLAGS += -D__aarch64__
ifeq ($(CONFIG_EVENLESS),y)
ifeq ($(CONFIG_EVL),y)
KBUILD_CFLAGS += -Iarch/$(SRCARCH)/evenless/include -Iinclude/evenless
endif
......
......@@ -157,7 +157,7 @@ obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/
obj-$(CONFIG_SOUNDWIRE) += soundwire/
obj-$(CONFIG_EVENLESS) += evenless/
obj-$(CONFIG_EVL) += evenless/
# Virtualization drivers
obj-$(CONFIG_VIRT_DRIVERS) += virt/
......
menu "Evenless OOB devices"
menu "Out-of-band device drivers"
config EVENLESS_LATMUS
config EVL_LATMUS
bool "Latency calibration and measurement"
depends on EVENLESS
depends on EVL
default y
config EVENLESS_HECTIC
config EVL_HECTIC
bool "OOB context switching validator"
depends on EVENLESS
depends on EVL
default y
endmenu
obj-$(CONFIG_EVENLESS_LATMUS) += latmus.o
obj-$(CONFIG_EVENLESS_HECTIC) += hectic.o
obj-$(CONFIG_EVL_LATMUS) += latmus.o
obj-$(CONFIG_EVL_HECTIC) += hectic.o
......@@ -15,7 +15,7 @@
#define EVL_ERR KERN_ERR "EVL: "
#define EVL_DEBUG(__subsys) \
IS_ENABLED(CONFIG_EVENLESS_DEBUG_##__subsys)
IS_ENABLED(CONFIG_EVL_DEBUG_##__subsys)
#define EVL_ASSERT(__subsys, __cond) \
(!WARN_ON(EVL_DEBUG(__subsys) && !(__cond)))
#define EVL_WARN(__subsys, __cond, __fmt...) \
......@@ -32,8 +32,8 @@
do { } while (0)
#endif
#define oob_context_only() EVL_WARN_ON_ONCE(CONTEXT, running_inband())
#define inband_context_only() EVL_WARN_ON_ONCE(CONTEXT, !running_inband())
#define oob_context_only() EVL_WARN_ON_ONCE(CORE, running_inband())
#define inband_context_only() EVL_WARN_ON_ONCE(CORE, !running_inband())
/* TEMP: needed until we have gotten rid of the infamous nklock. */
#define requires_ugly_lock() WARN_ON_ONCE(!(xnlock_is_owner(&nklock) && hard_irqs_disabled()))
......
......@@ -18,7 +18,7 @@ DECLARE_PER_CPU(struct evl_machine_cpudata, evl_machine_cpudata);
extern struct cpumask evl_oob_cpus;
#endif
#ifdef CONFIG_EVENLESS_DEBUG
#ifdef CONFIG_EVL_DEBUG
void evl_warn_init(const char *fn, int level, int status);
#else
static inline void evl_warn_init(const char *fn, int level, int status)
......
......@@ -69,7 +69,7 @@ void evl_flush_mutex(struct evl_mutex *mutex,
void evl_commit_mutex_ceiling(struct evl_mutex *mutex);
#ifdef CONFIG_EVENLESS_DEBUG_MUTEX_INBAND
#ifdef CONFIG_EVL_DEBUG_MUTEX_INBAND
void evl_detect_boost_drop(struct evl_thread *owner);
#else
static inline
......
......@@ -81,7 +81,7 @@ struct evl_rq {
struct evl_sched_rt rt;
/* Context of weak scheduling class. */
struct evl_sched_weak weak;
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
/* Context of runtime quota scheduling. */
struct evl_sched_quota quota;
#endif
......@@ -92,11 +92,11 @@ struct evl_rq {
struct evl_thread root_thread;
char *proxy_timer_name;
char *rrb_timer_name;
#ifdef CONFIG_EVENLESS_WATCHDOG
#ifdef CONFIG_EVL_WATCHDOG
/* Watchdog timer object. */
struct evl_timer wdtimer;
#endif
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
/* Last account switch date (ticks). */
ktime_t last_account_switch;
/* Currently active account */
......@@ -310,7 +310,7 @@ static inline void __evl_enable_preempt(void)
evl_schedule();
}
#ifdef CONFIG_EVENLESS_DEBUG_CORE
#ifdef CONFIG_EVL_DEBUG_CORE
void evl_disable_preempt(void);
void evl_enable_preempt(void);
......@@ -381,11 +381,11 @@ static inline int evl_init_rq_thread(struct evl_thread *thread)
evl_init_idle_thread(thread);
evl_init_rt_thread(thread);
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
ret = evl_quota_init_thread(thread);
if (ret)
return ret;
#endif /* CONFIG_EVENLESS_SCHED_QUOTA */
#endif /* CONFIG_EVL_SCHED_QUOTA */
return ret;
}
......@@ -518,7 +518,7 @@ static inline void evl_force_thread(struct evl_thread *thread)
}
struct evl_sched_group {
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
struct evl_quota_group quota;
#endif
struct list_head next;
......
......@@ -29,7 +29,7 @@ union evl_sched_param {
struct evl_idle_param idle;
struct evl_rt_param rt;
struct evl_weak_param weak;
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
struct evl_quota_param quota;
#endif
};
......
......@@ -5,14 +5,14 @@
* Copyright (C) 2013, 2018 Philippe Gerum <rpm@xenomai.org>
*/
#ifndef _EVENLESS_SCHED_QUOTA_H
#define _EVENLESS_SCHED_QUOTA_H
#ifndef _EVL_SCHED_QUOTA_H
#define _EVL_SCHED_QUOTA_H
#ifndef _EVENLESS_SCHED_H
#error "please don't include evenless/sched/quota.h directly"
#endif
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
#define EVL_QUOTA_MIN_PRIO 1
#define EVL_QUOTA_MAX_PRIO 255
......@@ -74,6 +74,6 @@ void evl_set_quota_period(ktime_t period);
ktime_t evl_get_quota_period(void);
#endif /* !CONFIG_EVENLESS_SCHED_QUOTA */
#endif /* !CONFIG_EVL_SCHED_QUOTA */
#endif /* !_EVENLESS_SCHED_QUOTA_H */
#endif /* !_EVL_SCHED_QUOTA_H */
......@@ -14,7 +14,7 @@
struct evl_rq;
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
struct evl_account {
ktime_t start; /* Start of execution time accumulation */
......@@ -105,7 +105,7 @@ void evl_set_counter(struct evl_counter *c, unsigned long value)
c->counter = value;
}
#else /* !CONFIG_EVENLESS_STATS */
#else /* !CONFIG_EVL_RUNSTATS */
struct evl_account {
};
......@@ -125,7 +125,7 @@ struct evl_counter {
#define evl_get_counter(__c) ({ 0; })
#define evl_set_counter(_c, __value) do { } while (0)
#endif /* CONFIG_EVENLESS_STATS */
#endif /* CONFIG_EVL_RUNSTATS */
/*
* Account the exectime of the current account until now, switch to
......
......@@ -60,7 +60,7 @@ struct evl_thread {
struct evl_sched_class *sched_class; /* Current scheduling class */
struct evl_sched_class *base_class; /* Base scheduling class */
#ifdef CONFIG_EVENLESS_SCHED_QUOTA
#ifdef CONFIG_EVL_SCHED_QUOTA
struct evl_quota_group *quota; /* Quota scheduling group. */
struct list_head quota_expired;
struct list_head quota_next;
......
......@@ -164,7 +164,7 @@ struct evl_timer {
struct evl_timerbase *base;
/* Timeout handler. */
void (*handler)(struct evl_timer *timer);
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
/* Timer name to be displayed. */
const char *name;
/* Timer holder in timebase. */
......@@ -173,7 +173,7 @@ struct evl_timer {
struct evl_counter scheduled;
/* Number of timer events. */
struct evl_counter fired;
#endif /* CONFIG_EVENLESS_STATS */
#endif /* CONFIG_EVL_RUNSTATS */
};
#define evl_tdate(__timer) ((__timer)->node.date)
......@@ -264,7 +264,7 @@ void __evl_init_timer(struct evl_timer *timer,
void evl_set_timer_gravity(struct evl_timer *timer,
int gravity);
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
#define evl_init_timer(__timer, __clock, __handler, __rq, __flags) \
do { \
......@@ -297,7 +297,7 @@ void evl_set_timer_name(struct evl_timer *timer, const char *name)
timer->name = name;
}
#else /* !CONFIG_EVENLESS_STATS */
#else /* !CONFIG_EVL_RUNSTATS */
#define evl_init_timer __evl_init_timer
......@@ -313,7 +313,7 @@ void evl_account_timer_fired(struct evl_timer *timer) { }
static inline
void evl_set_timer_name(struct evl_timer *timer, const char *name) { }
#endif /* !CONFIG_EVENLESS_STATS */
#endif /* !CONFIG_EVL_RUNSTATS */
#define evl_init_core_timer(__timer, __handler) \
evl_init_timer(__timer, &evl_mono_clock, __handler, NULL, \
......
......@@ -615,7 +615,7 @@ TRACE_EVENT(evl_timer_start,
TP_STRUCT__entry(
__field(struct evl_timer *, timer)
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
__string(name, timer->name)
#endif
__field(ktime_t, value)
......@@ -623,7 +623,7 @@ TRACE_EVENT(evl_timer_start,
),
TP_fast_assign(
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
__assign_str(name, timer->name);
#endif
__entry->value = value;
......@@ -631,7 +631,7 @@ TRACE_EVENT(evl_timer_start,
),
TP_printk("timer=%s value=%Lu interval=%Lu",
#ifdef CONFIG_EVENLESS_STATS
#ifdef CONFIG_EVL_RUNSTATS
__get_str(name),
#else
"?",
......
# Evenless real-time co-kernel
config HAVE_ARCH_EVENLESS
# EVL real-time core
config HAVE_ARCH_EVL
bool
menuconfig EVENLESS
bool "Enable the Evenless core"
depends on HAVE_ARCH_EVENLESS
menuconfig EVL
bool "Enable the EVL core"
depends on HAVE_ARCH_EVL
select DOVETAIL
help
The Evenless core is a real-time component of the Linux
kernel, which exhibits very short interrupt and scheduling
latency, without affecting the regular kernel services.
The EVL core is a real-time component of the Linux kernel,
which exhibits very short interrupt and scheduling latency,
without affecting the regular kernel services.
if EVENLESS
if EVL
source "kernel/evenless/Kconfig"
......
......@@ -107,7 +107,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/
obj-$(CONFIG_TRACEPOINTS) += trace/
obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-$(CONFIG_DOVETAIL) += dovetail.o
obj-$(CONFIG_EVENLESS) += evenless/
obj-$(CONFIG_EVL) += evenless/
obj-$(CONFIG_CPU_PM) += cpu_pm.o
obj-$(CONFIG_BPF) += bpf/
obj-$(CONFIG_KCSAN) += kcsan/
......
menu "Core features"
config EVENLESS_SCHED_QUOTA
config EVL_SCHED_QUOTA
bool "Thread groups with runtime quota"
default n
help
This option enables the SCHED_QUOTA scheduling policy in the
Evenless kernel.
EVL core.
This policy enforces a limitation on the CPU consumption of
threads over a globally defined period, known as the quota
......@@ -16,11 +16,11 @@ config EVENLESS_SCHED_QUOTA
If in doubt, say N.
config EVENLESS_STATS
config EVL_RUNSTATS
bool "Runtime statistics"
default y
help
This option causes the Evenless kernel to collect various
This option causes the EVL core to collect various
per-thread runtime statistics, which are accessible via
the /sys interface.
......@@ -28,46 +28,34 @@ endmenu
menu "Sizes and static limits"
config EVENLESS_SYS_HEAPSZ
config EVL_COREMEM_SIZE
int "Size of system heap (Kb)"
default 2048
help
The system heap is used for various internal allocations by
the Evenless kernel. The size is expressed in Kilobytes.
the EVL core. The size is expressed in Kilobytes.
config EVENLESS_SHARED_HEAPSZ
int "Size of shared heap (Kb)"
default 128
help
The Evenless core implements fast IPC mechanisms between
processes which require a shared kernel memory heap to be
mapped in the address space of all Evenless application
processes. This option can be used to set the size of this
system-wide heap.
64k is considered a large enough size for common use cases.
config EVENLESS_NR_THREADS
config EVL_NR_THREADS
int "Maximum number of threads"
range 1 4096
default 128
help
The maximum number of user-space threads attached to the
Evenless core which can run concurrently in the system.
EVL core which can run concurrently in the system.
config EVENLESS_NR_MONITORS
config EVL_NR_MONITORS
int "Maximum number of monitors"
range 1 16384
default 512
help
The monitor is the fundamental synchronization element
implemented by the Evenless core, which can underpin any other
implemented by the EVL core, which can underpin any other
synchronization mechanism. This value gives the maximum number
of monitors which can be alive concurrently in the system.
config EVENLESS_NR_CLOCKS
config EVL_NR_CLOCKS
int "Maximum number of clocks"
range 1 16384
default 8
......@@ -76,7 +64,7 @@ config EVENLESS_NR_CLOCKS
This value gives the maximum number of semaphores which can be
alive concurrently in the system for user-space applications.
config EVENLESS_NR_XBUFS
config EVL_NR_XBUFS
int "Maximum number of x-buffers"
range 1 16384
default 16
......@@ -85,7 +73,7 @@ config EVENLESS_NR_XBUFS
This value gives the maximum number of x-buffers which can be
alive concurrently in the system for user-space applications.
config EVENLESS_NR_PROXIES
config EVL_NR_PROXIES
int "Maximum number of proxies"
range 1 16384
default 64
......@@ -99,26 +87,26 @@ endmenu
menu "Latency settings"
config EVENLESS_TIMING_SCHEDLAT
config EVL_LATENCY_USER
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
first instruction of the 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".
If the latmus driver is enabled, this value will be used as the
factory default when running "latmus --reset".
config EVENLESS_TIMING_KSCHEDLAT
config EVL_LATENCY_KERNEL
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 Evenless kernel thread this handler
first instruction of the EVL kthread this handler
resumes. A default value of 0 (recommended) will cause a
pre-calibrated value to be used.
......@@ -129,7 +117,7 @@ config EVENLESS_TIMING_KSCHEDLAT
If the auto-tuner is enabled, this value will be used as the
factory default when running "autotune --reset".
config EVENLESS_TIMING_IRQLAT
config EVL_LATENCY_IRQ
int "Interrupt latency (ns)"
default 0
help
......@@ -143,37 +131,30 @@ config EVENLESS_TIMING_IRQLAT
endmenu
menuconfig EVENLESS_DEBUG
menuconfig EVL_DEBUG
bool "Debug support"
help
When enabled, various debugging features can be switched
on. They can help to find problems in applications, drivers,
and the Evenless kernel. EVENLESS_DEBUG by itself does not have
and the EVL core. EVL_DEBUG by itself does not have
any impact on the generated code.
if EVENLESS_DEBUG
if EVL_DEBUG
config EVENLESS_DEBUG_CORE
config EVL_DEBUG_CORE
bool "Core runtime assertions"
help
This option activates various assertions inside the Evenless
This option activates various assertions inside the EVL
core. This option has limited overhead.
config EVENLESS_DEBUG_CONTEXT
bool "Check for calling context"
help
This option enables checks for the calling context in the
Evenless kernel, aimed at detecting when regular Linux routines
are entered from a real-time context, and conversely.
config EVENLESS_DEBUG_MEMORY
config EVL_DEBUG_MEMORY
bool "Memory checks"
help
This option enables memory debug checks inside the Evenless
kernel. This option may induce significant overhead with large
This option enables memory debug checks inside the EVL
core. This option may induce significant overhead with large
heaps.
config EVENLESS_DEBUG_USER
config EVL_DEBUG_USER
bool "User consistency checks"
help
This option enables a set of consistency checks for
......@@ -181,9 +162,9 @@ config EVENLESS_DEBUG_USER
Some of these runtime checks may induce overhead, enable
them for debugging purposes only.
if EVENLESS_DEBUG_USER
if EVL_DEBUG_USER
config EVENLESS_DEBUG_MUTEX_INBAND
config EVL_DEBUG_MUTEX_INBAND
bool "Detect in-band mutex owner"
default y
help
......@@ -195,7 +176,7 @@ config EVENLESS_DEBUG_MUTEX_INBAND
This option may add overhead to out-of-band execution over
contented locks.
config EVENLESS_DEBUG_MUTEX_SLEEP
config EVL_DEBUG_MUTEX_SLEEP
bool "Detect sleeping while holding a mutex"
default y
help
......@@ -205,34 +186,35 @@ config EVENLESS_DEBUG_MUTEX_SLEEP
thread, it receives a SIGDEBUG signal right before entering
sleep.
This option has noticeable overhead in real-time mode as it
disables the normal fast locking operations from user-space,
causing a system call for each monitor enter/exit operation.
This option has noticeable overhead for out-of-band threads
as it disables the normal fast locking operations from
user-space, causing a system call for each monitor enter/exit
operation.
endif # EVENLESS_DEBUG_USER
endif # EVL_DEBUG_USER
config EVENLESS_WATCHDOG
config EVL_WATCHDOG
bool "Watchdog support"
default y
help
This option activates a watchdog aimed at detecting runaway
Evenless threads. If enabled, the watchdog triggers after a
given period of uninterrupted real-time activity has elapsed
EVL threads. If enabled, the watchdog triggers after a
given period of uninterrupted out-of-band activity has elapsed
without Linux interaction in the meantime.
In such an event, the current thread is moved out the
real-time domain, receiving a SIGDEBUG signal from the Linux
kernel immediately after.
out-of-band context, receiving a SIGDEBUG signal from the
Linux kernel immediately after.
The timeout value of the watchdog can be set using the
EVENLESS_WATCHDOG_TIMEOUT parameter.
EVL_WATCHDOG_TIMEOUT parameter.
config EVENLESS_WATCHDOG_TIMEOUT
depends on EVENLESS_WATCHDOG
config EVL_WATCHDOG_TIMEOUT
depends on EVL_WATCHDOG
int "Watchdog timeout"
default 4
range 1 60
help
Watchdog timeout value (in seconds).
endif # EVENLESS_DEBUG
endif # EVL_DEBUG
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment