All of lore.kernel.org
 help / color / mirror / Atom feed
* [Draft RFC] Bring POSIX signal to evl
@ 2024-12-18 12:26 Qichen Qiu
  2024-12-19 14:31 ` Jan Kiszka
  2024-12-19 15:43 ` Philippe Gerum
  0 siblings, 2 replies; 6+ messages in thread
From: Qichen Qiu @ 2024-12-18 12:26 UTC (permalink / raw)
  To: xenomai; +Cc: ruiqurm

Hi all, 

Currently, EVL does not support POSIX signals. To better align with 
Xenomai and Cobalt (see the CXP [1]), we need to add POSIX signal 
support to EVL. As far as I can tell, there may be two potential 
approaches: 

# Approach 1: Adapt the current flags mechanism to POSIX signals 

EVL offers an alternative to signals called flags [1], which allows 
sending a 32-bit word to another thread. The flags mainly offers the
service:
* use `evl_create_flags` or `evl_open_flags` to open a flag element. 
* use `evl_wait_flags` to wait a specific bit and evl_post_flags to 
post one or some bits. 

The mechanism is like a POSIX real-time signal without queueing. 
However, there are notable differences between flags and POSIX signals 
that would need to be addressed:
* Signal Capacity: Cobalt supports 63 signals (excluding pseudo 
signals), while flags are limited to 32 due to the monitor's design. 

* Initialization: POSIX signals are pre-configured and require no 
explicit initialization by the sender or receiver. In contrast, EVL's 
flags require users to initialize and open them manually. 

* Target: In POSIX, signals can target either processes or threads, 
whereas in EVL, the target mechanism is more limited. 

* Sigqueue: POSIX signals can carry additional data (sigqueue), while 
EVL flags are restricted to 4 bytes of payload. 

* Queueing: POSIX real-time signals are queued, whereas EVL flags only 
store the most recent signal, making them more similar to standard 
signals. 

While it is possible to adapt the current flags implementation to 
address these differences, I believe doing so would overcomplicate the 
existing mechanism. For this reason, I prefer an alternative approach: 
migrating the Xenomai POSIX signal subsystem to EVL. 

# Approach 2: Migrate the Xenomai POSIX Signal Subsystem to EVL 

Xenomai implements a signal subsystem. For each Cobalt thread, it 
maintains:
* A wait channel (sigwait) to sleep and wake up while waiting for a 
signal. 
* A sigqueue structure to store pending signals. 
* A sigwait_context to hold the user-space waiting context. 
* A field sigpending to track the current pending signal for the thread.

Philippe once suggested that the new POSIX-like API "would be 
implemented as a separate driver using the EVL kernel API" [3], meaning
the POSIX signal support would be loaded as an EVL driver. However, 
since signal sending and receiving are per-thread or per-process 
operations, the signal module would need to attach data to each EVL 
thread. This integration seems challenging for a standalone driver. 
Instead, I propose integrating the implementation directly into the 
current kernel. 

Before starting work on this, I would like to gather feedback and 
suggestions from the community. Thank you for your input. 

Best regards,
Sam 


[1] https://lore.kernel.org/xenomai/87mtyr1abi.fsf@xenomai.org/
[2] https://evlproject.org/core/user-api/flags
[3] https://riot.im/app/#/room/#evlproject:matrix.org/$kFRgs7y48Qr0033GNh-sDnI7GUrrp_mo-OEhDI0GAWk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-20  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 12:26 [Draft RFC] Bring POSIX signal to evl Qichen Qiu
2024-12-19 14:31 ` Jan Kiszka
2024-12-20  8:46   ` Qichen Qiu
2024-12-19 15:43 ` Philippe Gerum
2024-12-20  8:59   ` Qichen Qiu
     [not found]   ` <CAHR=ZXGvkXv1vEEitQmjY36xDT0D+s-SNVxW4a8CdD0RFxh1kQ@mail.gmail.com>
2024-12-20  9:04     ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.