| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Conditional expressions with inline functions are not optimized away if
optimization is disabled. Avoid such expressions to prevent dead
branches. It helps also during code review to immediately see if a loop
is used or not.
|
|
|
|
|
|
|
| |
The real implementation of hardpps() is defined in kern_ntptime.c. Use it only
if the NTP support is needed by the application.
Update #2349.
|
|
|
|
|
|
|
|
| |
Use CLOCK_REALTIME and CLOCK_MONOTONIC for relative thread queue timeouts
instead of CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE. This fixes an
issue with clock_nanosleep() in combination with clock_gettime().
Close #4669.
|
|
|
|
|
|
| |
Since pps->capgen equal to zero is not a special value in uniprocessor configurations, there is no need to check for this condition.
Update #2349
|
|
|
|
|
|
| |
Return early only if there was a timeout, otherwise return the PPS info.
Update #2349.
|
|
|
|
| |
Close #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
|
|
| |
Rename tc_getfrequency() to _Timecounter_Get_frequency().
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
| |
Update #2349.
|
|
|
|
|
|
| |
Remove URL in copyright notice.
Update #3053.
|
| |
|
| |
|
|
|
|
|
| |
These files had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
|
|
|
|
| |
Close #4644.
|
| |
|
|
|
|
|
|
|
| |
Add SMP-specifc SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR
fatal error. This fatal error helps to diagnose a broken SMP startup
sequence. Without this error a context switch using the NULL pointer
for the thread control block happens which may be difficult to debug.
|
|
|
|
|
|
|
| |
This function may be used to burn a couple of processor cycles with
minimum impact on the system bus. It may be used in busy wait loops.
Since it is a global function, it is possible to wrap it in device
driver test code.
|
|
|
|
| |
Updates #4625.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous SMP multitasking start assumed that the initial heir thread of a
processor starts execution in _Thread_Handler(). The _Thread_Handler() sets
the interrupt state explicitly by _ISR_Set_level() before it calls the thread
entry. Under certain timing conditions, processors may perform an initial
context switch to a thread which already executes its thread body (see
smptests/smpstart01). In this case, interrupts are disabled after the context
switch on targets which do not save/restore the interrupt state during a
context switch (aarch64, arm, and riscv).
Close #4627.
|
|
|
|
|
|
|
| |
Disable thread dispatching earlier on secondary processors. This ensures that
fatal error and per-CPU job handlers are called with thread dispatching
disabled. On the boot processor, the thread dispatching is already disabled by
_Thread_Dispatch_initialization().
|
| |
|
|
|
|
| |
Updates #3053.
|
|
|
|
| |
Updates #3053.
|
|
|
|
| |
Updates #3053.
|
|
|
|
| |
Updates #3053.
|
|
|
|
|
|
| |
Remove previous adjtime() implementation.
Update #2348.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The file was imported from this repository:
https://github.com/freebsd/freebsd.git
This commit was used:
commit 3ec0dc367bff27c345ad83240625b2057af391b9
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Mon Feb 7 14:16:16 2022 -0700
kern_ntptime.c: Remove ntp_init()
The ntp_init() function did set a couple of global objects to zero. These
objects are in the .bss section and already initialized to zero during kernel
or module loading.
Update #2348.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two places where we convert from a timecounter delta to
a bintime delta: tc_windup and bintime_off.
Both functions use the same calculations when the timecounter delta is
small. But for a large delta (greater than approximately an equivalent
of 1 second) the calculations were different. Both functions use
approximate calculations based on th_scale that avoid division. Both
produce values slightly greater than a true value, calculated with
division by tc_frequency, would be. tc_windup is slightly more
accurate, so its result is closer to the true value and, thus, smaller
than bintime_off result.
As a consequence there can be a jump back in time when time hands are
switched after a long period of time (a large delta). Just before the
switch the time would be calculated with a large delta from
th_offset_count in bintime_off. tc_windup does the switch using its own
calculations of a new th_offset using the large delta. As explained
earlier, the new th_offset may end up being less than the previously
produced binuptime. So, for a period of time new binuptime values may
be "back in time" comparing to values just before the switch.
Such a jump must never happen. All the code assumes that the uptime is
monotonically nondecreasing and some code works incorrectly when that
assumption is broken. For example, we have observed sleepq_timeout()
ignoring a timeout when the sbinuptime value obtained by the callout
code was greater than the expiration value, but the sbinuptime obtained
in sleepq_timeout() was less than it. In that case the target thread
would never get woken up.
The unified calculations should ensure the monotonic property of the
uptime.
The problem is quite rare as normally tc_windup should be called HZ
times per second (typically 1000 or 100). But it may happen in VMs on
very busy hypervisors where a VM's virtual CPU may not get an execution
time slot for a second or more.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Panzura LLC
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hyper-V wants to register its MSR-based timecounter during
SI_SUB_HYPERVISOR, before SI_SUB_LOCK, since an emulated 8254 may not be
available for DELAY(). So we cannot use MTX_SYSINIT to initialize the
timecounter lock.
PR: 259878
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33014
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BSPs provide memory for the workspace initialization via
_Memory_Get(). Most BSPs provide exactly one memory area. Only two
BSPs provide more than one memory area (arm/altera-cyclone-v and
bsps/powerpc/mpc55xxevb). Only if more than one memory area is
provided, there is a need to use _Heap_Extend(). Provide two
implementations to initialize the workspace handler and let the BSP
select one of the implementations based on the number of provided memory
areas. This gets rid of a dependency on _Heap_Extend(). It also avoids
dead code sections for most BSPs.
|
|
|
|
| |
Splitting the file avoids unnecessary link-time dependencies.
|
|
|
|
|
|
| |
Change licence according to file history.
Update #3053.
|
|
|
|
|
|
|
|
|
|
| |
The _Thread_queue_Extract() does not deal with potential priority
updates and the SMP locking protocol handling. Use
_Thread_queue_Continue(). For the POSIX signals processing this is
currently probably unnecessary, however, the use case is similar to the
restart so use the same appoach.
Close #4546.
|
|
|
|
|
|
|
| |
Simplify _Thread_queue_Surrender_no_priority() and use
_Thread_queue_Resume().
Update #4546.
|
|
|
|
|
|
|
| |
Move _Thread_queue_Extract() since this function is not used by the core
services (threads, semaphores, mutexes, message queues).
Update #4546.
|
|
|
|
|
|
|
|
|
|
| |
Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to
indicate that a thread does not wait on something. Rename
THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY. This change is necessary
so that _Thread_Continue() can be called for threads which never waited on
something (for example dormant threads).
Update #4546.
|
|
|
|
|
|
|
|
| |
Remove _Thread_queue_Extract_with_proxy() and move the proxy extraction
to _Thread_MP_Extract_proxy(). Move similar code blocks of the previous
caller of _Thread_queue_Extract_with_proxy() to helper functions.
Update #4546.
|
|
|
|
|
|
|
| |
The earlier we remove the thread timer the less likely is a superfluous
thread timeout processing.
Update #4546.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SMP EDF scheduler supports a one-to-one and one-to-all thread to
processor affinity. It accepted affinity sets which are a proper
subset of the online processor containing at least two processors owned by
the scheduler. In this case it used a one-to-one thread to processor
affinity. This leads to undefined behaviour if a processor is removed
since the higher level check in rtems_scheduler_remove_processor() does
not account for this implementation detail.
Restrict the affinity set accepted by the SMP EDF scheduler to
1. all online processors, or
2. exactly one processor owned by the scheduler.
Close #4545.
|
|
|
|
|
|
|
|
| |
Process ask for help requests on the current processor. This avoids
using inter-processor interrupts to make the system behaviour a bit more
predictable.
Update #4531.
|
|
|
|
|
|
|
|
|
| |
Simplify callers of _Scheduler_SMP_Schedule_highest_ready(). Move the node
state change and the extraction from scheduled into
_Scheduler_SMP_Schedule_highest_ready(). Move the idle thread release to the
caller which have more information about the presence of an idle thread.
Update #4531.
|
|
|
|
| |
Update #4531.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The SMP EDF scheduler supports one-to-one and one-to-all thread to
processor affinities. The one-to-one thread to processor affinity
introduces a constraint on the ordering of threads. The implementation
uses one ready queue for threads which have a one-to-all affinity and
one for each one-to-one affinity group. To order threads across the
ready queues, a generation number is used. However, the approach to
update the generation number each time a thread is inserted into a ready
queue was wrong. The generation number needs to be updated only in the
enqueue and enqueue scheduled operations where an insert priority is
available. The scheduled chain needs to take the generation number into
account.
An example scenario which shows the bug is this. Let T be a high
priority task affine to processor X. Let A be a lower priority task
affine to processor X. Let B be a lower priority task with no affinity
to a particular processor which executes on processor Y. Let B be in
the same priority group than A and after A. Let T set the affinity to
all processors. Now A (higher priority relative to B) should execute on
X and T (high priority) should execute on Y.
Close #4534.
|
|
|
|
|
|
| |
This allows to use additional members of the nodes for comparision.
Update #4534.
|