- 18 Mar, 2019 1 commit
-
-
Jan Kiszka authored
This instruments the sched-quota scheduling policy to track which groups exit, with which settings, and which threads belong to them. As trace_cobalt_schedquota_add_thread may be invoked before a thread is fully initialized, we need to trace also the thread address. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 04 Feb, 2019 1 commit
-
-
Jan Kiszka authored
Required to handle compat syscalls correctly. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 16 Jan, 2019 2 commits
-
-
Disabling round-robin is obtained by passing XN_INFINITE for quantum to xnthread_set_slice(), which is zero: we don't want to check such value against the clock gravity. As a matter of fact, this bug may have prevented the RR mode to be switched off for years, causing the routine to always fail early with -EINVAL. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Non-cobalt kernel code may hook interrupts using ipipe_request_irq() directly, which means that xnintr_vec_first() cannot assume that __ipipe_irq_cookie() always returns a valid xnintr struct for all irqs. We need to detect those irqs while iterating over the interrupt namespace when pulling data from /proc files not to dereference invalid memory. Fixes: /proc/xenomai/irq /proc/xenomai/sched/stat /proc/xenomai/sched/acct Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 09 Jan, 2019 1 commit
-
-
We should mark the current task as not owning the fpu anymore if it does actually own the fpu, not if the fpu itself is active. Fixes cb52e6c7 Reported-by:
Mauro Salvini <mauro.salvini@smigroup.net> Signed-off-by:
Henning Schild <henning.schild@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 20 Dec, 2018 1 commit
-
-
Jan Kiszka authored
This drops the naming of each release, lowering the creative effort for the release manager and, thus, potentially raising the motivation to release more often. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 06 Dec, 2018 1 commit
-
-
In order to prevent unexpected truncation of pointer args in userland with the LP64 data model, libcobalt's fcntl() wrapper should accept a long (3rd) argument. Anticipate this change in the corresponding syscall implementation in the Cobalt core. The updated ABI remains backward-compatible for current users. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 30 Nov, 2018 5 commits
-
-
This is actually a plain conversion of the former sched_declare() handler to the recently introduced sched_chkparam(), which only checks the weak scheduling parameters. By doing so, we ensure that those checks are done early and unconditionally in xnsched_set_policy(). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Move parameter checks from sched_declare() to the new sched_chkparam() handler, which runs early and unconditionally from xnsched_set_policy(). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Move parameter checks from sched_declare() to the new sched_chkparam() handler, which runs early and unconditionally from xnsched_set_policy(). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
This is actually a plain conversion of the former sched_declare() handler to the recently introduced sched_chkparam(), which solely checks the parameter block. By doing so, we ensure that those checks are done early and unconditionally in xnsched_set_policy(). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
We need policy-specific scheduling parameters to be checked early and unconditionally before applying them in xnsched_setparam(), even if the current scheduling policy does not change for the target thread (i.e. sched_declare() is not called). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 28 Nov, 2018 1 commit
-
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 23 Nov, 2018 1 commit
-
-
Jan Kiszka authored
If we change the quota value of thread group, we should take its already consumed time during the current cycle into account. So far, we refilled the budget blindly, which could have given the group an uncontrolled "peak". This commit first update the run_budget_ns of an active group and kills its limit timer. Then it refills run_budget_ns only with the remaining budget of the current cycle, taking the new quota as limit. Accumulated credits are still dropped - not worth to deal with their complexity in this scenario. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 17 Oct, 2018 1 commit
-
-
RTDM drivers refer to open files or sockets by using struct rtdm_fd. Normally, the user-side file descriptors returned by socket() or open() calls are not necessary for driver operations. However, in some special cases the user-side fd has to be determined, for example as return value of rt_tcp_accept() which is a driver function of RTnet's TCP protocol driver. Signed-off-by:
Sebastian Smolorz <sebastian.smolorz@gmx.de> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 10 Oct, 2018 1 commit
-
-
Jan Kiszka authored
If xnregistry_enter in mq_open fails, the new entry will not be added to cobalt_mqq. But the cleanup path taken afterwards will nevertheless try to remove it from there. That will cause a crash because the mq->link is uninitialized. Fix that by initializing it as list head so that list removal becomes harmless, even when the entry is not on any list.. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 02 Oct, 2018 3 commits
-
-
xnsched_realtime_cpus is a misnomer defining the set of CPUs which may handle timer events. cobalt_cpu_affinity is a subset of xnsched_realtime_cpus which defines which CPU(s) may run Cobalt threads. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
cobalt_cpu_affinity defines the CPU set which may run Cobalt threads, which is a subset of xnsched_realtime_cpus. I.e. we may handle IRQs over CPUs which do not run threads. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Attempting to migrate to the head domain while running on a CPU which is not in part of the real-time set is a bug, and must be detected by the core. Furthermore, for this detection to work, the I-pipe must not BUG() unconditionally when failing to schedule out such thread in __ipipe_migrate_head(), but rather let the real-time core handle the situation (i.e. Xenomai in xnthread_harden()). Until both changes are in place, running a thread issuing a real-time call over a non-RT CPU would trigger a BUG() assertion, e.g.: With kernel parameter "xenomai.supported_cpus=2", running: $ switchtest --cpu-affinity=0 would lead to: [ 11.681486] kernel BUG at kernel/sched/core.c:5816! [ 11.686343] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 24 Sep, 2018 1 commit
-
-
asm/uaccess.h is an arch-local, partial header which may cause build issues if included directly. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 17 Sep, 2018 4 commits
-
-
4.14 is always eager, unfortunately we will need a few ifdefs inside the eager fpu support as well. Signed-off-by:
Henning Schild <henning.schild@siemens.com> [Jan: converted C++-style comment] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Signed-off-by:
Henning Schild <henning.schild@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Linux 4.4.138 switched to eager fpu, set IPIPE_X86_FPU_EAGER accordingly. Signed-off-by:
Henning Schild <henning.schild@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Upstream 4.14 switched to purely eager fpu switching. That was backported to 4.4 and 4.9. This commit makes cobalt able to deal whith the changed kernel behaviour. This commit takes care of 4.9 to begin with. Introduce IPIPE_X86_FPU_EAGER to switch between the new and the old implementations. The new implementation is much simpler than the old one. We basically only deal with the odd case where Xenomai preempts Linux in a kernel-fpu context. In a regular Linux that can never happen and if it happens we need to make sure to get things into a consistent state. We have to make "current" as not owning the fpu anymore and allow others to use in-kernel fpu (kernel_fpu_enable). __switch_to from Linux will do the rest. Signed-off-by:
Henning Schild <henning.schild@siemens.com> [Jan: converted C++-style comments] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 06 Sep, 2018 3 commits
-
-
Jan Kiszka authored
The put_siginfo functions return a non-zero value on error. We have to convert that into proper -EFAULT before returning. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
The original watchdog mechanism was based on a sampling method: every second (built-in value), it used to check the runtime mode of the current task preempted on the ticking CPU. A per-cpu counter was increased by one every time rt/primary mode was detected, then checked against the trigger limit (CONFIG_XENO_OPT_WATCHDOG_TIMEOUT). Otherwise, the counter was reset to zero. With this fairly naive approach, it only takes a single hit with CONFIG_XENO_OPT_WATCHDOG_TIMEOUT=1 to trigger the watchdog, i.e. if the system-fixed 1s watchdog tick preempts any Xenomai task when it is running in primary mode on the current CPU, the watchdog fires. The default value of 4s papered over the inherent imprecision of such a coarse-grained method, lengthening the odds of observing false positive triggers. To improve the accuracy of the watchdog, arm the watchdog timer to fire at the final trigger date directly, right before switching the CPU to primary mode (leave_root()), disarming it when the CPU is about to switch back to secondary mode (enter_root()). Better accuracy comes at the expense of slightly more overhead when transitioning between primary and secondary modes, which should be acceptable for a debug feature which is not affecting the hot path anyway (i.e. there is no added cost for strictly rt context switches). Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 04 Sep, 2018 1 commit
-
-
Move scheduler init/cleanup bits to dedicated routines. This concentrates scheduler related code in the sched module. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> [Jan: tweak commit message] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 03 Sep, 2018 4 commits
-
-
Jan Kiszka authored
This should have been used only by rtdm_printk_ratelimited which was switched to xnclock_ratelimit. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This will service as an internal building block for RT-safe rate-limited printk (printk_ratelimit() is not suited). It's derived from the RTDM variant, but simplied (central lock, static parameters). We will switch rtdm_printk_ratelimited to this implementation later on. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This reverts commit e2520f81 . The change was simply wrong, the return code was already passed, but that is hidden in the parameter list of cobalt_call_extension. The latter return 1 if a callback was invoked. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 28 Aug, 2018 1 commit
-
-
Philippe Gerum authored
The calibration procedure overwrites the current value of the timer counter for a pending oneshot tick event, which is admittedly ok in the context of initializing Cobalt. However, the previous implementation maxed the counter value, potentially causing excessive delay to the host waiting for the overwritten timer event. Use a shorter delay value when calibrating so that the next shot does not occur later than one jiffy after we left the calibration routine. One jiffy is also long enough for preventing the timer to ever fire while running the calibration loop.
-
- 22 Aug, 2018 1 commit
-
-
Philippe Gerum authored
The calibration procedure overwrites the current value of the timer counter for a pending oneshot tick event, which is admittedly ok in the context of initializing Cobalt. However, the previous implementation maxed the counter value, potentially causing excessive delay to the host waiting for the overwritten timer event. Use a shorter delay value when calibrating so that the next shot does not occur later than one jiffy after we left the calibration routine. One jiffy is also long enough for preventing the timer to ever fire while running the calibration loop.
-
- 01 Aug, 2018 4 commits
-
-
This aligns the return code with cobalt_sched_setschedparam_ex: If there is no u_winoff and no thread, we should return ESRCH so that userspace can easily detect that it should call the standard libc service instead. Fix the core and remove the related workaround from the userspace lib. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
It's always current, and it can only be current. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Detect if the caller passed the PID of a remote thread that we do not know yet. In that case, do not try to shadow anything, that will only end up in a mess. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
If the caller has already a Xenomai shadow, we will crash rather than failing gracefully. The reason is that pthread_discard expects secondary mode - which may not be the case if the caller is already able to migrate. So check early and avoid that we can run into this trap. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 14 Jul, 2018 1 commit
-
-
Philippe Gerum authored
No I-pipe architecture supports PIC muting anymore.
-
- 03 Jul, 2018 1 commit
-
-
They may fail as well, requiring us to return that code to the caller of signal_wait. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-