-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lkl: add support for multiple system call threads #86
Conversation
a couple of high-level comments.
|
For the CI fail, I've noticed is that on 32bits architecture you must use lkl_sys_fcntl64, on 64bits you must use lkl_sys_fcntl. |
@phhusson correct, I am testing that right now :) @thehajime I don't know if it is applicable to hijacking. Do you have any use-case in mind? @thehajime yes, I will add nt support |
In posix-host.c, you'll have to rename gettid function, it conflicts when building on Android target |
This looks great! Reviewed 9 of 9 files at r1. arch/lkl/kernel/syscalls.c, line 281 [r1] (raw file): arch/lkl/kernel/syscalls.c, line 294 [r1] (raw file): Comments from the review on Reviewable.io |
NR_IRQS is defined by the number of bits, not bytes, which fit in the long datatype. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
lib/virtio.c:107:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] buf->addr = (void *)le64toh(vring_desc->addr); Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
lib/nt-host.c:179:2: warning: initialization from incompatible pointer type [enabled by default] lib/nt-host.c:179:2: warning: (near initialization for ‘lkl_host_ops.sem_alloc’) [enabled by default] Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
2fa4b13
to
ebdf472
Compare
One of the current limitation of LKL is that all system calls are serialized which limits the usability of LKL with threading applications. As an example, lets take an application that waits for data on a network socket using a blocking call to read() and occasionally write()s data from another application thread. Once the read() syscall has been issued, no write()s can be performed until the socket receives some data and returns from the read(). This patch adds support for multiple system call threads so that the application can issue multiple system calls. Note that only one system call will be executed (i.e. LKL is still non SMP) at a time, but if one system call blocks, another one can be executed. In order to do so, the application must issue lkl_create_syscall_thread from the context of a host thread. A new kernel thread will be created and all subsequent system calls from the host thread will be queued to the newly created kernel thread. All the host threads that call lkl_create_syscall_thread must call lkl_stop_syscall_thread and this must happen before lkl_halt is called. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
ebdf472
to
8fd6824
Compare
Review status: 2 of 12 files reviewed at latest revision, 2 unresolved discussions. arch/lkl/kernel/syscalls.c, line 281 [r1] (raw file): arch/lkl/kernel/syscalls.c, line 294 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 2 of 12 files reviewed at latest revision, 1 unresolved discussion. arch/lkl/kernel/syscalls.c, line 281 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 3 of 10 files at r2, 7 of 7 files at r3. Comments from the review on Reviewable.io |
lkl: add support for multiple system call threads
One of the current limitation of LKL is that all system calls are
serialized which limits the usability of LKL with threading applications.
As an example, lets take an application that waits for data on a
network socket using a blocking call to read() and occasionally
write()s data from another application thread. Once the read() syscall
has been issued, no write()s can be performed until the socket
receives some data and returns from the read().
This patch adds support for multiple system call threads so that the
application can issue multiple system calls. Note that only one system
call will be executed (i.e. LKL is still non SMP) at a time, but if
one system call blocks, another one can be executed.
In order to do so, the application must issue
lkl_create_syscall_thread from the context of a host thread. A new
kernel thread will be created and all subsequent system calls from the
host thread will be queued to the newly created kernel thread.
All the host threads that call lkl_create_syscall_thread must call
lkl_stop_syscall_thread and this must happen before lkl_halt is
called.
Signed-off-by: Octavian Purdila octavian.purdila@intel.com