Commit Graph

1331 Commits

Author SHA1 Message Date
pooka
e7d4a69ab6 tty support is finally a standalone component 2010-06-14 14:47:58 +00:00
pooka
e0986a806a Add unadulterated tty support as a rump component. 2010-06-14 14:45:47 +00:00
pooka
d2e364992d ptyfs rump component 2010-06-14 14:36:15 +00:00
njoly
e97daef49a Add rmdir(2) support for rump filsystem.
With help from pooka.
2010-06-14 13:40:25 +00:00
pooka
f51be744dd Remove comment which wasn't supposed to get committed. 2010-06-14 13:28:44 +00:00
pooka
0733340220 Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.
2010-06-14 13:25:40 +00:00
pooka
9c6bb4c515 Move FLAWLESSCALL from rump_dev_private.h into rump_private.h
so it can be used outside of devices.
2010-06-13 16:49:01 +00:00
pooka
a2b72aafa2 Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.
2010-06-13 15:17:02 +00:00
pooka
7ed9d6c421 deal with sun3's module disability 2010-06-13 11:35:41 +00:00
pooka
83474ef4e9 add rest of sparc pagesize variables 2010-06-13 11:05:58 +00:00
pooka
4df1419c47 Support rumpkern components and rumpkern components depending on vfs init. 2010-06-12 07:13:54 +00:00
pooka
7f57b57dc8 Add infrastructure for kern compnents. This is meant for those
components which are too bloaty to be included in rumpkern (where
bloaty means "can be easily left out without anyone missing"), but
generally do not require the support of the dev/fs/net factions to
function.  As the first one, add ksems.  librumpcrypto will migrate
here too once I get my timeslice to deal with the setlists, as most
likely will tty support.
2010-06-10 21:56:42 +00:00
pooka
eacf4402b9 Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"
2010-06-10 21:40:42 +00:00
pooka
df76692de4 regen: ksem syscalls 2010-06-10 19:10:09 +00:00
pooka
451e6b4882 Version rumpuser ABI with a lightweight mechanism. 2010-06-09 14:08:17 +00:00
pooka
4fe99aa4c5 initialize specificdata for lwp0 too 2010-06-09 13:51:02 +00:00
pooka
aad71fb6e2 On amd64, allocate module_map memory from the lowest 2GB. 2010-06-09 12:02:37 +00:00
pooka
3f4944e6bb Add the ability to specify a preferred address the "map anon memory"
hypercall.
2010-06-09 11:35:36 +00:00
pooka
4b8e90305c Similarly to cv_wait, fail if trying to cv_wait_sig() without threads. 2010-06-09 07:54:13 +00:00
pooka
0c93fc168a The previous revision worked brilliantly if all you wanted to test
was autoload *not* working with an alternate path.  This revision
make the code double as good in the sense that it now works also
in case you *do* want it to work.
2010-06-08 21:57:49 +00:00
pooka
1ef2da668c Allow to set a non-standard module_base for host kernel module loading. 2010-06-08 17:17:33 +00:00
pooka
5bc163461f Rump components do not, at least for now, get to tell what's NEEDED. 2010-06-07 13:57:20 +00:00
njoly
e800a040dc Make vers.c depend on sys/param.h too, to ensure that this file is
regenerated for on kernel version bump. Avoids __NetBSD_Version__ and
osrelease out of sync problem for mkupdate builds.

ok from pooka@.
2010-06-06 20:09:38 +00:00
njoly
edf3b80fb4 Regen for pathconf/fpathconf rumpification. 2010-06-04 16:33:32 +00:00
pooka
c91a51436f Don't use rumpuser_malloc() directly. 2010-06-03 19:36:21 +00:00
pooka
8b0211dc06 Implement a sort-of pagedaemon: adjust all memory allocators to go
through an in-rumpkernel hypermemory allocator which knows it should
kick the pagedaemon and block in case ``waitok'' memory allocation
fails.

This allows us to recover from some out-of-memory situations.
Realworld'istically speaking (as opposed to whatever "should be"
theory), these OOM situations will happen extremely rarely if ever
when our hypervisor is a regular process.  Speculatively, this
should be useful for other types of hosts.

issues remaining:
 * the hypervisor does not know how to reclaim kernel memory (and
   for the reason I stated above, I'm not sure if it makes sense
   to teach the current implementation about that)
 * vfs memory (buffers, vm object pages etc.) is not reclaimed
2010-06-03 10:56:20 +00:00
pooka
03d9f8436f In aiodone, call uvm_pageout_done() with number of PG_PAGEOUT pages
processed.
2010-06-02 12:07:03 +00:00
pooka
8e9f71e9f5 rumpvm_init -> uvm_init to get rid of local prototype.
no functional change
2010-06-02 10:55:18 +00:00
pooka
e3c273abc1 Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there.  Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().
2010-06-01 20:11:33 +00:00
pooka
89600f9afb Always use rumpuser_malloc() for allocating both poolpage and
poolpage_cache -- its bootstrap cost is slightly higher than
anonmmap, but it's faster in the long run.
2010-06-01 19:18:20 +00:00
pooka
6a58bb3a83 * remove rumpvm_makepage, just use uvm_pagealloc()
* update copyright to reflect reality a little better
2010-06-01 10:29:21 +00:00
pooka
a590bfb92a Support mtsleep() without a biglocked sleeper (uvm uses this in
UVM_UNLOCK_AND_WAIT())
2010-05-31 23:18:33 +00:00
pooka
977a0ef122 Dump rump kernel bootstrap time. 2010-05-31 23:13:17 +00:00
pooka
9970bb9e64 Support KTHREAD_JOINABLE/kthread_join(). Also fixes earlier bug
where all pthreads were created non-detached.
2010-05-31 23:09:29 +00:00
pooka
7210d18f43 The x86 kernel ABI depends on __cpu_simple_lock stuff being present.
Since they are practically never used (only when prehistoric code
uses simple_lock()), their efficiency doesn't matter that much and
we can simply adapt the versions from x86 lock.h.
2010-05-31 22:31:07 +00:00
pooka
01c45b7fe9 Deal with the "we get a portably arbitrary set of headers on
different archs" problem.
2010-05-28 18:17:24 +00:00
pooka
d11274ecfd 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.
2010-05-28 16:44:14 +00:00
pooka
5f75591d60 regen: rump_vfs_mount_print 2010-05-26 21:51:58 +00:00
pooka
7e5ec0880b Add public namespace helper routine for dumping info on mountpoints. 2010-05-26 21:50:56 +00:00
pooka
c468a8e0bf print vm object refcount 2010-05-26 21:48:20 +00:00
pooka
9df433ebd4 include extattr support 2010-05-20 18:23:59 +00:00
pooka
8cfbddcc72 one more file to commit with regen 2010-05-20 15:58:09 +00:00
pooka
1a99fb9d2c regen: rump_vfs_extattrctl 2010-05-20 15:47:45 +00:00
pooka
e1f101dffa open VFS_EXTATTRCTL to user namespace 2010-05-20 15:46:47 +00:00
martin
d806a53fa5 Add missing include 2010-05-18 20:18:18 +00:00
pooka
0f6a90c207 Whoops, default to MP locking. 2010-05-18 16:30:22 +00:00
pooka
d47455e39d Add uniprocessor versions of mutex/rw/cv. They work only on virtual
unicpu configurations (i.e. RUMP_NCPU==1), but are massively faster
than the multiprocessor versions since the fast path does not have
to perform any cache coherent operations.  _Applications_ with
lock-happy kernel paths, i.e. _not_ lock microbenchmarks, measure
up to tens of percents speedup on my Core2 Duo.  Every globally
atomic state required by normal locks/atomic ops implies a hideous
speed penalty even for the fast path.

While this requires a unicpu configuration, it should be noted that
we are talking about a virtual unicpu configuration.  The host can
have as many processors as it desires, and the speed benefit of
virtual unicpu is still there.  It's pretty obvious that in terms
of scalability simple workload partitioning and replication into
multiple kernels wins hands down over complicated locking or
locklessing algorithms which depend on globally atomic state.
2010-05-18 16:29:36 +00:00
pooka
a955550ec3 Namespace rump-only kernel biglock routines appropriately.
No functional change.
2010-05-18 15:16:10 +00:00
pooka
fdeac1d7df Move routines related to kernel locking and scheduling from
locks.c to klock.c.

No functional change.
2010-05-18 15:12:19 +00:00
pooka
b1b7862792 Make it possible to use the scheduler lock as the rumpuser condvar
interlock.  This is applicable in cases where the actual interlock
is the CPU the currently running thread is scheduled on.  Borrowing
the scheduler lock as the mutex mandated by pthread_cond_wait()
does away with need to have an additional mutex.  This both optimizes
runtime execution and simplifies code, as the extra lock typically
lead to quite some trickeries to avoid the dungeon collapsing due
to zaps from the wand of deadlock.
2010-05-18 14:58:41 +00:00