Commit Graph

273 Commits

Author SHA1 Message Date
Philippe Gerum 4f4b3a3955 include/tube: guard against store tearing/fusing
We need concurrent readers to always observe consistent ->next pointer
values. We don't want the compiler to combine updates to it.
2019-11-27 16:55:05 +01:00
Philippe Gerum bcd69eaba5 lib/heap: use 'raw size' to denote the full storage length
The raw size is the length of the memory area which includes both the
user data _and_ the meta-data we need for maintaining the heap.
2019-11-27 10:01:15 +01:00
Philippe Gerum 390b6925eb lib/timer: return -ENXIO on missing evl_init() 2019-11-26 10:57:22 +01:00
Philippe Gerum 08592109f8 include: add 'tube' data path
A lighweight, lockless multi-reader/multi-writer FIFO with a
base-offset variant which can work over a memory segment shared
between processes. Scalar data or simple (small!) aggregates are
conveyed though a tube inside canisters which exactly fit their type.
By design, a tube is meant to be a basic, spartan mechanism: it
imposes no usage policy whatsoever on users.

As a result, a tube is strictly non-blocking, it solely detects and
notifies the caller on return about empty input (no message in) and
output contention (no buffer space for output). If required, the
caller can implement blocking states, typically with a pair of EVL
semaphores, e.g. setting up a tube conveying integers which supports
blocking mode:

    DECLARE_EVL_TUBE_CANISTER(canister_type, int); /* defines struct canister_type */
    DECLARE_EVL_TUBE(tube_type, cannister_type) tube;
    struct cannister_type items[1024];

    evl_init_tube(&tube, items, 1024);
    evl_new_sem(&in, ...);
    evl_new_sem_any(&out, CLOCK_MONOTONIC, tube.max_items, ...);

    evl_get_sem(&in, ...);           @      evl_get_sem(&out);
    evl_tube_receive(&tube, ...);    @      evl_tube_send(&tube, ...);
    evl_put_sem(&out);               @      evl_put_sem(&in, ...);
2019-11-19 10:30:13 +01:00
Philippe Gerum 43807a1793 include/compiler: add helpers for offset-based addressing 2019-11-18 16:11:47 +01:00
Philippe Gerum 309948a52e include/atomic: move compiler barrier to the proper header 2019-11-18 12:28:47 +01:00
Philippe Gerum 0527a500af build: enable -Wshadow=local 2019-11-17 18:56:58 +01:00
Philippe Gerum 84410a8886 benchmarks/hectic: do not use local shadow variables 2019-11-17 18:51:05 +01:00
Philippe Gerum d04d98df91 lib/proxy: fix error code propagation 2019-11-13 12:02:32 +01:00
Philippe Gerum d9f26b70b0 lib, eshi: move version string to evl_version 2019-11-13 10:00:39 +01:00
Philippe Gerum 154e577193 lib, eshi: add evl_get_version()
Returns version information about the running EVL interface including
the API and kernel ABI levels. A negative ABI level denotes the EVL
shim layer (eshi).
2019-11-13 09:25:53 +01:00
Philippe Gerum cba6a9958b lib/proxy: improve self-documentation 2019-11-12 19:04:27 +01:00
Philippe Gerum 2241780425 tests/monitor-pp-pi: increase delay to account for high load
Stress load running in parallel to this test might be high enough to
have udelay() actually skipped by the EVL core since the sleep_until
(absolute) form is used internally, preventing evl_schedule() from
ever being called, which in turn skip the PP boost for the caller.
This has been observed on qemu-aarch64 under extreme load.

Increase the delay to 5ms.
2019-11-07 14:14:13 +01:00
Philippe Gerum 158fbbf720 lib/monitor: force synchronize PTEs of shared state data 2019-11-07 13:55:47 +01:00
Philippe Gerum 43502b6a6c utils/evl: supersede -A with -V, adding version info 2019-11-05 18:23:04 +01:00
Philippe Gerum 4190e92a2a tests: monitor-event: disable WOLI to enable scenario 2019-10-31 14:02:44 +01:00
Philippe Gerum 92883647a6 tests: tame down useless verbosity 2019-10-31 13:55:40 +01:00
Philippe Gerum a52108f061 tests: mutex deadlock detection 2019-10-31 13:55:40 +01:00
Philippe Gerum 4d507a51ed lib/clock: rename evl_sleep() to evl_sleep_until()
Make it obvious that the call accepts an absolute timeout spec.
2019-10-19 20:41:11 +02:00
Philippe Gerum 3fc210432a tests/heap-torture: fix delay call 2019-10-19 20:37:26 +02:00
Philippe Gerum 2942364038 utils/evl: test: fix variable expansion bug 2019-10-14 10:37:33 +02:00
Philippe Gerum 8c4d38ffb2 utils/evl: test: early detect invalid test 2019-10-10 15:03:47 +02:00
Philippe Gerum aa91bb02a1 tests: event with multiple waiters/lock 2019-10-09 19:05:34 +02:00
Philippe Gerum 9b316d24f2 lib/event: keep wait status safe upon EINTR 2019-10-09 19:04:51 +02:00
Philippe Gerum b976d32635 utils/evl: test: fix 'keep going' logic (-k) 2019-10-09 12:36:56 +02:00
Philippe Gerum 2a8c26f6b6 utils/evl: test: add list-only command (-l) 2019-10-09 12:36:56 +02:00
Philippe Gerum fb1299e0b3 utils/ps: fix %CPU display 2019-10-07 18:27:17 +02:00
Philippe Gerum bde7a117d9 utils/evl: add test helper 2019-09-21 12:11:20 +02:00
Philippe Gerum e6d92fbeaa eshi/mutex: return zero on get_ceiling() in non-PP case
Follows new libevl behavior.
2019-08-24 15:47:58 +02:00
Philippe Gerum 672bc22c7c lib/mutex: return zero on get_ceiling() in non-PP case
This is a simple way to figure out the protocol of a mutex without
crippling the API with trivial accessors people might need twice a
century.
2019-08-24 12:37:22 +02:00
Philippe Gerum bed2532942 lib/event: introduce compact creation calls
Events timed on the monotonic clock is the most common form used by
applications. Allow people to write more compact code by providing
creation calls and static initializers aimed at building these
directly:

- evl_new_event(), EVL_EVENT_INITIALIZER() for events timed on the
  monotonic clock.

- evl_new_event_any() and EVL_EVENT_ANY_INITIALIZER() usable for
  specifying the clock.
2019-08-19 12:25:18 +02:00
Philippe Gerum 2738fcfc3f evl: bump API revision
In the wake of adding recursive mutexes and compact creation calls for
synchronization objects.
2019-08-19 10:24:28 +02:00
Philippe Gerum a7a084ea15 lib/sem: introduce compact creation calls
Zero-initialized semaphores timed on the monotonic clock is the
most common form used by applications. Allow people to write more
compact code by providing creation calls and static initializers aimed
at building these directly:

- evl_new_sem(), EVL_SEM_INITIALIZER() for zero-init semaphores
  timed on the monotonic clock.

- evl_new_sem_any() and EVL_SEM_ANY_INITIALIZER() usable for any
  initialization form, specifying the clock and init value.
2019-08-19 10:22:49 +02:00
Philippe Gerum 5af05a5020 lib/flags: introduce compact creation calls
Zero-initialized event groups timed on the monotonic clock is the
most common form used by applications. Allow people to write more
compact code by providing creation calls and static initializers aimed
at building these directly:

- evl_new_flags(), EVL_FLAGS_INITIALIZER() for zero-init event groups
  timed on the monotonic clock.

- evl_new_flags_any() and EVL_FLAGS_ANY_INITIALIZER() usable for any
  initialization form, specifying the clock and init value.
2019-08-19 10:22:49 +02:00
Philippe Gerum bdc3aab501 lib/mutex: introduce compact creation calls
Normal (i.e. non-recursive) mutexes timed on the monotonic clock are
the most common form of locks used by applications. Allow people to
write more compact code by providing creation calls and static
initializers aimed at building these directly:

- evl_new_mutex(), EVL_MUTEX_INITIALIZER() for PI locks timed on the
  monotonic clock.

- evl_new_mutex_any() and EVL_MUTEX_ANY_INITIALIZER() for building any
  supported type of lock (normal/recursive), specifying the protocol
  (PI/PP) and the base clock.
2019-08-19 10:22:49 +02:00
Philippe Gerum a6044094db lib/mutex: add support for recursive type 2019-08-18 16:30:47 +02:00
Philippe Gerum f052b6d31c eshi: EVL shim library
The EVL shim library mimics the behavior of the original EVL API based
on plain POSIX calls from the native *libc, which does not require the
EVL core to be enabled in the host kernel. It is useful when the
real-time guarantees delivered by the EVL core are not required for
quick prototyping or debugging application code.
2019-08-09 19:07:39 +02:00
Philippe Gerum ec669471c0 tests/poll-nested: expect -ELOOP on circular loop 2019-08-09 16:01:11 +02:00
Philippe Gerum 26f0ed1a4d benchmarks, utils: add verbosity to installation rule 2019-08-09 12:05:13 +02:00
Philippe Gerum 49fc9571a2 tests/monitor-flags: extend timeout on second wait call 2019-08-09 12:05:13 +02:00
Philippe Gerum f50f26c99e tests/poll-close: drop useless object path 2019-08-08 13:10:35 +02:00
Philippe Gerum 65a374d0cf tests/clock-timer-periodic: switch to 64bit timer readouts 2019-08-08 13:10:35 +02:00
Philippe Gerum 5e95213578 include/mutex: clarify variable naming 2019-08-08 13:10:35 +02:00
Philippe Gerum 950e5c1cd7 include/proxy: clarify variable naming 2019-08-07 11:19:13 +02:00
Philippe Gerum 22f73c4467 lib/heap: include atomic helpers explicitly 2019-08-07 10:11:48 +02:00
Philippe Gerum 457a878a20 include: drop useless forward declarations 2019-08-07 10:11:03 +02:00
Philippe Gerum c7c785c060 lib/event: check mutex sanity in wait ops 2019-08-07 10:10:34 +02:00
Philippe Gerum 147ff5aeae utils/ps: display count of remote wakeups
RWA (Remote-WAkeups) reports the number of times a thread was readied
and rescheduled from a remote CPU. Available with the -s display
format.
2019-08-02 15:47:24 +02:00
Philippe Gerum 6ac46dfa8d utils/evl: add -A switch to get the ABI revision 2019-07-29 15:19:44 +02:00
Philippe Gerum f7f59262fb benchmarks/latmus: add more details to histogram dump 2019-07-28 18:46:46 +02:00