Home | History | Annotate | Download | only in rumpkern
History log of /src/sys/rump/librump/rumpkern/threads.c
RevisionDateAuthorComments
 1.28  04-Oct-2023  ad rump now needs lwp_need_userret()
 1.27  01-Aug-2020  riastradh Define kthread_fpu_enter/exit for rump.

XXX Not 100% sure that it's safe to touch curlwp->l_flag in this
context, but this change will make progress, at least.
 1.26  21-Apr-2017  kamil Fix build of rump after change in lwp_create's signature
 1.25  21-Apr-2017  christos - Propagate the signal mask from the ucontext_t to the newly created thread
as specified by _lwp_create(2)
- Reset the signal stack for threads created with _lwp_create(2)
 1.24  26-Jan-2016  pooka branches: 1.24.2; 1.24.4;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.
 1.23  09-Apr-2014  pooka branches: 1.23.4;
implement lwp_create() and a few related interfaces.
main raison d'impalerment: the aio driver
 1.22  15-Mar-2014  pooka branches: 1.22.2;
Allow compile-time optimizations to curlwp. This can have a pretty
staggering impact on performance. When running sendto() in a loop,
the improvement is 200k more calls per second with an inlined __thread
curlwp as opposed to the default. In other words, it shaves off hundreds
of CPU cycles per call (~20%). Even just eliminating the x86_curlwp()
call in favor of an inline gives an improvement of 60k calls per second.
 1.21  02-May-2013  pooka branches: 1.21.4;
Inform the rump kernel hypervisor of valid thread contexts so
that the implementation can allocate and release storage for them
in an optimal fashion, if necessary.
 1.20  30-Apr-2013  pooka In kthread_create(), pass the priority and cpu index down to the
rump kernel hypervisor (though the current implementation doesn't take
advantage of them).
 1.19  27-Apr-2013  pooka roll mutex init hypercalls into one (one of them already took a flag anyway)
 1.18  10-Mar-2013  pooka Don't allow kernel threads to run before all CPUs have been initialized
to avoid them getting scheduled on non-initialized CPUs.
 1.17  04-Nov-2012  pooka Add vdrain to the list of kernel threads.
 1.16  04-Nov-2012  pooka Use a table to check for kernel threads.
 1.15  07-Aug-2011  rmind branches: 1.15.2; 1.15.12;
Rename slightly misleading KTHREAD_JOINABLE to KTHREAD_MUSTJOIN.
 1.14  17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.13  29-Oct-2010  pooka Attach implicit threads to initproc instead of proc0. This way
applications which alter, by purpose or by accident, the uid in an
implicit thread are don't affect kernel threads.

from discussion with njoly
 1.12  01-Sep-2010  pooka Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.
 1.11  03-Jun-2010  pooka Don't use rumpuser_malloc() directly.
 1.10  31-May-2010  pooka Support KTHREAD_JOINABLE/kthread_join(). Also fixes earlier bug
where all pthreads were created non-detached.
 1.9  28-May-2010  pooka Improve the CPU scheduler for a host MP system with multithreaded
access. The old scheduler had a global freelist which caused a
cache crisis with multiple host threads trying to schedule a virtual
CPU simultaneously.

The rump scheduler is different from a normal thread scheduler, so
it has different requirements. First, we schedule a CPU for a
thread (which we get from the host scheduler) instead of scheduling
a thread onto a CPU. Second, scheduling points are at every
entry/exit to/from the rump kernel, including (but not limited to)
syscall entry points and hypercalls. This means scheduling happens
a lot more frequently than in a normal kernel.

For every lwp, cache the previously used CPU. When scheduling,
attempt to reuse the same CPU. If we get it, we can use it directly
without any memory barriers or expensive locks. If the CPU is
taken, migrate. Use a lock/wait only in the slowpath. Be very
wary of walking the entire CPU array because that does not lead to
a happy cacher.

The migration algorithm could probably benefit from improved
heuristics and tuning. Even as such, with the new scheduler an
application which has two threads making rlimit syscalls in a tight
loop experiences almost 400% speedup. The exact speedup is difficult
to pinpoint, though, since the old scheduler caused very jittery
results due to cache contention. Also, the rump version is now
70% faster than the counterpart which calls the host kernel.
 1.8  09-Feb-2010  pooka branches: 1.8.2; 1.8.4;
Store l_name for kernel threads.
 1.7  27-Jan-2010  pooka branches: 1.7.2;
ignore pmf threads if RUMP_THREADS == 0
 1.6  05-Dec-2009  pooka KERNEL_UNLOCK_LAST in non-mpsafe kthread exit.
 1.5  03-Dec-2009  pooka Soft-fail xcall thread creation to make RUMP_THREADS=0 work again.
 1.4  01-Dec-2009  pooka Almost there for virtual CPU MP support:
* support bound kernel threads
* bind softint threads to specific virtual cpus
+ remove now-unnecessary locks from softint code

Now, if we only had MI CPU_INFO_FOREACH() .... (hi rmind ;)
 1.3  09-Nov-2009  pooka adjust comment for previous
 1.2  09-Nov-2009  pooka set LP_INTR for KTHREAD_INTR
 1.1  04-Nov-2009  pooka Give the kthread->pthread interface emulation its own module.
 1.7.2.4  06-Nov-2010  uebayasi Sync with HEAD.
 1.7.2.3  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.7.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.7.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.8.4.3  05-Mar-2011  rmind sync with head
 1.8.4.2  03-Jul-2010  rmind sync with head
 1.8.4.1  30-May-2010  rmind sync with head
 1.8.2.4  09-Oct-2010  yamt sync with head
 1.8.2.3  11-Aug-2010  yamt sync with head.
 1.8.2.2  11-Mar-2010  yamt sync with head
 1.8.2.1  09-Feb-2010  yamt file threads.c was added on branch yamt-nfs-mp on 2010-03-11 15:04:38 +0000
 1.15.12.4  03-Dec-2017  jdolecek update from HEAD
 1.15.12.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.12.2  23-Jun-2013  tls resync from head
 1.15.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.15.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.2.1  16-Jan-2013  yamt sync with (a bit old) head
 1.21.4.1  18-May-2014  rmind sync with head
 1.22.2.1  10-Aug-2014  tls Rebase.
 1.23.4.2  28-Aug-2017  skrll Sync with HEAD
 1.23.4.1  19-Mar-2016  skrll Sync with HEAD
 1.24.4.2  23-Apr-2017  bouyer Sync with HEAD
 1.24.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.24.2.1  26-Apr-2017  pgoyette Sync with HEAD

RSS XML Feed