- Apr 02, 2014
-
-
Claudio Fontana authored
this contains still prototyped code, which if reached either hangs (setjmp, longjmp), aborts (all that requires mmu::), or implements differently (allocating with malloc instead of mmap) This is enough libc AArch64 support for reaching the end of premain. Signed-off-by:
Claudio Fontana <claudio.fontana@huawei.com>
-
- Apr 01, 2014
-
-
Glauber Costa authored
The current ballooning mechanism has a very serious design flaw, that became obvious once the tests with it advanced: if we wait until memory is short to release memory, it may be that the JVM itself may block. In particular, the blocking thread can be running the Garbage Collector. More likely, it can start running the GC to open up space for an object so big as the balloon. I don't believe this is something we should fix with a quick hack, and I am then pushing for a redesign: The solution is to use a reservation system, that works by ballooning beforehand when the amount of reserved memory goes too low. This system works by noting that when we balloon, we are effectively limiting the maximum amount of memory java will ever use. We already have accounts of both the amount of free memory and the amount of memory allocated to the heap. With those figures, we can easily find out when the amount of used memory + a full heap would go over the amount of available memory. When that happens, we balloon. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com>
-
Glauber Costa authored
We can determine which mappings from the JVM are heap areas in a more robust way by flipping a flag when we start JVM creation, and flipping it back when we are finished. Doing this early is more robust and should work better with a bigger set of GCs. Although this is a heuristic, Calle agrees this is safe, and it has been tested and confirmed to work with the following options: -XX:+UseSerialGC -XX:+UseG1GC -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseConcMarkSweepGC which pretty much covers all relevant GCs Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com>
-
- Mar 25, 2014
-
-
Nadav Har'El authored
Implement __sysv_signal(), which is used by code using signal() when compiled with _XOPEN_SOURCE, -std=..., or something similar (see signal(2) manual page for a full discussion of the two variants of signal()). Fixes #238. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Instead of duplicating sigaction()'s code, let's just use it. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Add signal number verification to sigaction(). Also add a FIXME comment that we don't support mode sa_flags. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Mar 24, 2014
-
-
Nadav Har'El authored
Add missing scandir() function from musl 1.0.0. Fixes #237. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Mar 21, 2014
-
-
Nadav Har'El authored
Add support for SA_RESETHAND signal handler flag, which means that the signal handler is reset to the default one after handling the signal once. I admit it's not a very useful feature (our default handler is powering off the system...) but no reason not to support it. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Don Martin writes: I'm experimenting with Capstan, trying to rule out some things for getting a bigger application working. I have a simple program to recursively list directory contents, here... https://github.com/dmarti/mini-ls It works on the host, but when I build the .so, the "capstan build" step works, and then when I do "capstan run"... $ capstan run OSv v0.05-501-gdbdf4f7 Failed looking up symbol alphasort This is missing libc functionality in OSv. To fix that, add the alphasort function from musl. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Mar 17, 2014
-
-
Gleb Natapov authored
Implement shmget/shmat/shmdt/shmctl function required by System V shared memory interface. Signed-off-by:
Gleb Natapov <gleb@cloudius-systems.com>
-
- Mar 06, 2014
-
-
Takuya ASADA authored
This is required for '--interval' option on iperf. The code was taken from musl-libc. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Takuya ASADA <syuu@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
We didn't notice this, but disabling the debugging messages also disabled the assertion failure messages! The user only sees "Aborted" and you can only tell what happened with a debugger. Instead of using kprintf(), pass the message directly to abort(), which will print its argument to the console as expected. Since we using the overloading abort(...), it now needs to be done in a C++ source file. So move this function from libc/exit/assert.c, to runtime.cc. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Feb 22, 2014
-
-
Tomasz Grabiec authored
It's needed by openssl. It supposed to return NULL if the environemnt is not trusted. Our implementation just delegates to getenv(). Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Feb 06, 2014
-
-
Nadav Har'El authored
This patch addresses the bugs of *use* of the dynamic linker - looking up symbols or iterating the list of loaded objects - in parallel with new libraries being loaded with get_library(). The underlying problem is that we have an unprotected "_modules" vector of loaded objects, which we need to iterate to look up symbols, but this list of modules can change when a new shared object is loaded. We decided *not* to solve this problem by using the same mutex protecting object load/unload: _mutex. That would make boot slower, as threads using new symbols are blocked just because another thread is concurrently loading some unrelated shared object (not a big problem with demand-paged file mmaps). Using a mutex can also cause deadlocks in the leak detector, because of lock order reversal between malloc's and elf'c mutexes: malloc() takes a lock first and then backtrace() will take elf's lock, and on the other hand elf can take its lock and then call malloc taking malloc's lock. Instead, this patch uses RCU to allow lock-free reading of the modules list. As in RCU, writing (adding or removing an object from the list) manufactures a new list, defering the freeing of the old one, allowing reads to continue using the old object list. Note that after this patch, concurrent lookups and get_library() will work correctly, but concurrent lookups and object *unload* still will still not be correct because we need to defer an object's unloading from memory while lookups are in progress. This will be solved in a following patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Feb 02, 2014
-
-
Avi Kivity authored
Useful for debugging. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Jan 27, 2014
-
-
Nadav Har'El authored
Remove unused #include of <drivers/clock.hh>. Except the clock drivers and <osv/clock.hh>, no source file now now include this header. Rather, <osv/clock.hh> should be used. Code including <sched.hh> will also get <osv/clock.hh> automatically. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Fix pthread_cond_timedwait to set the absolute timer using a timepoint, instead of the old s64. Moreover, now that we have both a wall-clock and monotonic clock, we can support pthread_condattr_setclock, so this patch also adds this support. OpenJDK 8, for example, cannot run without this support (it assumes that if the OS supports CLOCK_MONOTONIC, it can also configure condition variables to use it). Unfortunately supporting pthread_condattr_setclock - the only condition- variable attribute that really exists - grows the pthread condition variable structure :( Fixes #168. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Drop the s64 literals _ms, _ns, etc., from <drivers/clock.hh>. Fix a few places which still use the old literals. The std:chrono::duration version from <osv/clock.hh> remains - but remember you need to "using namespace osv::clock::literals" to use them. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Change alarm() implementation to use the new <osv/clock.hh> APIs and the monotonic clock. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Delete the sched::thread::sleep_until() function. All users of this function actually wanted a relative time, not absolute time, and can use the simpler new sched::thread::sleep() instead. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Switch the timerfd to use std::chrono types, and add support also for the monotonic clock. Fixes #142. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Switch the thread scheduler from using the s64 type for durations and the wall time, to the osv::clock::uptime::duration type (which is std::chrono::nanoseconds) and monotonic clock. Also, now that the per-thread CPU-time clock (thread::thread_clock()) returns an std::chrono::duration instead of s64, we no longer need the fill_ts(s64) variant in libc/time.cc (if we leave it unused, we'll get a compilation warning). Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 22, 2014
-
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Move definitions from <debug.h> to <osv/debug.h> and update includes to use the latter. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 20, 2014
-
-
Vlad Zolotarov authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 19, 2014
-
-
Nadav Har'El authored
sysinfo() until now was a stub. This patches fills some of the information we can already provide, namely the uptime in seconds (through the recently added osv::clock::uptime()), the total and free memory (through the recently added memory::stats::free()/total() functions), and number of processes (always 1 on OSv). This patch also changes a couple of types from unsized names (like "unsigned") to fixed-sized ones (like "u32"), to match the definition of this structure on Linux. It won't make any difference on x86_64, but perhaps in some future architecture it will. Tested-by:
Amnon Heiman <amnon@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 17, 2014
-
-
Pekka Enberg authored
Currently, RLIMIT_STACK is 64 KB. This is too small for the JVM which limits stack size to RLIMIT_STACK if a VMA range that covers address found in '__libc_stack_end' in /proc/self/maps. In preparation for procfs support, switch to pthread_attr_getstacksize() for RLIMIT_STACK. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add pthread_attr_getstacksize() in preparation for fixing RLIMIT_STACK. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 16, 2014
-
-
Nadav Har'El authored
Output to stdout normally goes to file descriptor 1. However, during early boot, before the console is opened on file descriptor 1, we also want printf() to work. So this case is specially treated in libc/stdio/__stdout_write.cc, where in this early case, we used debug_write directly, instead of write to the file descriptor. However, recent patches changed debug_write to write to a memory buffer, instead of to screen (unless "--verbose" option is given to the loader). This made early printf() break too. This patch changes __stdout_write to use console::write(), not debug_write(). To use console::write(), I had to convert that source file to C++. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 15, 2014
-
-
Nadav Har'El authored
Add a type-safe std::chrono interface to the wall-clock time. E.g., use use osv::clock::wall::now() to get an std::chrono::time_point instead of clock::get()->time() which returns an s64. This patch also changes clock_gettime(CLOCK_REALTIME) and gettimeofday() to use the new osv::clock::wall::now() interface. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 13, 2014
-
-
Dmitry Fleytman authored
Signed-off-by:
Dmitry Fleytman <dmitry@daynix.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-