- 05 Jun, 2021 40 commits
-
-
Philippe Gerum authored
With this rework, we have two separate per-thread mode flags for greater flexibility aimed at controlling the debug features on a per-thread basis: - T_WOSS can be set to trigger SIGDEBUG upon (unexpected) stage switch to in-band mode. This is strictly equivalent to the obsoleted T_WARN bit. - T_WOLI enables/disables the detection of locking inconsistencies with mutexes via the EVL_THRIOC_{SET, CLEAR}_MODE interface. This combines the former static CONFIG_EVL_DEBUG_MUTEX_INBAND and CONFIG_EVL_DEBUG_MUTEX_SLEEP options. Enabling CONFIG_EVL_DEBUG_WOLI turns on T_WOLI by default for every new EVL thread running in userland, which can be opted out on a per-thread basis using EVL_THRIOC_CLEAR_MODE. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
The new hierachy of priority scales is as follows: EVL_CORE_MIN_PRIO = EVL_WEAK_MIN_PRIO ... EVL_FIFO_MIN_PRIO == EVL_QUOTA_MIN_PRIO == EVL_TP_MIN_PRIO (== 1) ... EVL_FIFO_MAX_PRIO = EVL_QUOTA_MAX_PRIO == EVL_TP_MAX_PRIO == EVL_WEAK_MAX_PRIO (< MAX_USER_RT_PRIO) ... EVL_CORE_MAX_PRIO (> MAX_RT_PRIO) We reserve a couple of priority levels above the highest inband kthread priority (MAX_RT_PRIO..MAX_RT_PRIO+1), which are guaranteed to be higher than the highest inband user task priority (MAX_USER_RT_PRIO-1) we use for SCHED_FIFO. Those extra levels can be used for EVL kthreads which must top the priority of any userland thread. SCHED_EVL was dropped int the process, since userland is now constrained to EVL_FIFO_MAX_PRIO by construction. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Requires a couple of ABI changes. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
We don't plan for switching CPU from out-of-band context anymore, so T_MOVED is basically pointless now. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
This protocol operates the monitor value as a set of boolean event flags forming a 32bit-wide event group. All bits from a group are initially set to zero. An event flag group is a lightweight notification mechanism. The application can send bitmasks to raise individual bits from the group (i.e. group_value |= bits), or wait for the group to have at least one bit set for satisfying the request. In the latter case, the group value is read then cleared atomically, and the collected bits are returned to the thread heading the wait queue. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Introduce a 'protocol' specifier for monitors along with a basic type (gate or event), which userland can pass to change the way a monitor can be signaled and awaited. Define PI/PP gates using this new information bit associated to the generic EVL_MONITOR_GATE type. With this change in, the pre-existing ungated event can be enriched with additional protocols beyond the semaphore-based P/V operations. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
We may collect negative delta values when sampling latency on fast machines, make sure the delta sum which is used in calculating the average is signed, to prevent weird results. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Make sure breakage and/or WARN_ON() in the in-band transition code we use for fixing up a trap on the oob stage cannot cause handle_oob_trap() to be called recursively, leading to a stack overflow eventually. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Elements: -------- Basic features that cant be implemented from userland sharable between processes. Threads, monitors, xbufs and clocks -> every instance is backed by a device in /dev/evl which allows sharing. Utilities --------- poll is a private-process construct; all poll groups are obtained from a single multiplex device: /dev/evl/poll. They cannot be shared. timers are in essence timerfd directly obtained from clocks, they don't exist on their own, and are process-local too. proxies are backed by a device in /dev/evl to allow for sharing, but this is not something essential. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
The hectic utility needs to tell us whether some rtus/rtup/rtuo threads are about to start waiting for an out-of-band event, so that they don't miss a signal from the sleeper/switcher. This information is now passed at UTASK registration time, which ensures that HECTIC_OOB_WAIT is present in the task base flags early enough before a SWITCH_TO request may target them. Otherwise, the first evl_raise_flag() might be skipped in absence of HECTIC_OOB_WAIT in the base flags of the target task, when the sleeper/switcher manages to issue SWITCH_TO before such task enter the PEND routine, which was seen at several occasions on very slow platforms with 4+ CPUs (e.g. kvm-less qemu). A typical test case involved running the following commands in parallel on a 4-way configuration: $ latmus $ hectic rtuo2 rtuo3 In that case, tasks on CPU3 would miss the initial signal from the sleeper/switcher. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
A significant portion of EVL is derived from Xenomai's cobalt core: state this clearly and refer to https://xenomai.org in all related files. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Since userland converted semaphore support to using ungated monitors, we have no more users of the standalone semaphore element. Drop it. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
This is a special form of the wait operation which is not protected by a lock. Userland is assumed to deal with signal-vs-wait races in its own way. An event value is now available from the monitor's state, which can be tested for signedness as the fixed condition for waiting, which comes in handy for implementing semaphore behavior. Plain flag-type behavior could be implemented the same way. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
We want userland to receive EFAULT when bad pointers are passed to the SET/GET operations, not SIGSEGV. So we need to handle any itimerspec copy directly from kernel space. At this chance, change the element name visible by userland from "timerfd" to "timer", not to confuse people. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Combine the mapper and logger facilities into a single file proxy element. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
There is no upside in sharing pollers between application processes, since file descriptors are process-local handles in essence. Therefore pollers are process-local utilities, so we don't need them to be visible from the file system. Downgrade the poller element to a plain single device from the factory. Each open instance of such device is a polling channel. At this chance, do a general rename from poller to poll, to match commonly accepted naming. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
There is no upside in sharing loggers between application processes, since they do not (and will not) deal with file locking. Therefore loggers are process-local utilities, so we don't need them to be visible from the file system. Downgrade the logger element to a plain single device from the factory. Each open instance of such device is a logging channel. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
No upside in measuring timeout delays differently than referring to EVL_CLOCK_MONOTONIC. Let's converge to epoll_wait() in this respect. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Runtime mode setting is a self-applicable operation, and as such must go through the control device where evl_current() implicitly applies. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Significant optimizations can happen only when acquire/release ops involve single increment/decrement. Although we loose the ability to implement read/write locking, we can still do that using a monitor protecting an access map. So let's make the semaphore code fast and right for the most common usage. Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-