- Jan 21, 2014
-
-
Nadav Har'El authored
Add cwd (current directory) and env (environment variable) option to the loader. Can be useful for certain applications that expect to be in a certain directory, or certain environment variables to exist. Example usage: run.py -e "--cwd=/tmp /usr/bin/something.so" Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Takuya ASADA authored
Test case for dladdr(), to make sure it returns correct symbol in these cases: - addr is less than 'vfprintf'. Should returns another symbol. - addr is equals to 'vfprintf'. Should returns 'vfprintf' as the result. - addr is bigger than 'vfprintf', and also inside of it. Should returns 'vfprintf' as the result. 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>
-
Avi Kivity authored
Instead of acquiring sockbuf::sb_mtx inside sblock() and sbunlock(), rely on the caller to take the lock for us. Expand existing lock hold regions in callers to make it so. This reduces acquisitions of sb_mtx. As a side effect, copies to and from userspace are done under the lock. This can affect MSG_NOWAIT with demand paging major faults, but these are screwed anyway. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
sb_rwlock is used to serialize concurrent writers (or readers) to the same socket buffer, but is quite expensive as it requires 4 atomic operations per transaction, even if there is no contention. Replace it with a waitqueue, and use the sockbuf::sb_mtx for serialization. This still has exactly the same cost, but we can later move sblock() and sbunlock() into contexts where the sockbuf::sb_mtx is already acquired. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
sblock() takes sb_rwlock for reading, and is the only such locker, so it clearly has no effect. Change it to acquire the lock for writing, so it serializes access to the socket buffer as intended. Bug introduced in 6296cbab. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
This allows placing C++ objects in ifnet. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Include the system header and remove duplicate definitions. Change some solaris imports to use _GNU_SOURCE to make rlim64_t defined consistently. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Allows making ifnet a C++ class. Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Dmitry Fleytman authored
It is a bad practice to have DHCP discovery without timeout and retries. In case discovery packet gets lost boot stucks. Beside this there is an interesting phenomena on some systems. A few first DHCP discovery packets sent on boot get lost in some cases. This started to happen from time to time on my KVM system and almost every time on my Xen system after installing recent Fedora Core updates. Packet leaves VM's interface but never arrives to bridge interface. The packet itself built properly and arrives to DHCP server just fine after a few retransmissions. Most probably this phenomena is a bug (or limitation) in the current Linux bridge version so this patch is actually a work-around, but since in general case it is a good idea to have DHCP timeouts/retries it worth to have it anyway. Signed-off-by:
Dmitry Fleytman <dmitry@daynix.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Force version.h generation to make sure the version number matches the git version. I noticed the problem after tagging v0.05-rc1 and noticing that OSv happily reported the same version even after applying patches. Use the special ".PHONY" target suggested by Tomek to avoid breakage from previous attempt that is documented in commit 996fdfde ('Revert "build: Force version.h generation"'). Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
I don't know how chdir() ever worked - apparently it didn't! It took an argument "pathname", and then declared a local "path" and used that, not pathname, as the path :-) Obviously, a call to task_conv, which converts a relative "pathname" to an absolute "path", was missing... chdir() is still a mess and incompatible in the error cases with Linux's chdir(). I'll fix that, and add a test, in a follow-up patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 20, 2014
-
-
Avi Kivity authored
Lightweight waitqueue and wait_for() primitive. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Pekka Enberg authored
Dor Laor writes: - Ballooning causes to issues and we like to disable it: 1. Parallel GC 2 GC threads are trying to move memory around and they do it optimistically without locking. This fools our memmov logic. Gleb and Glauber have a solution (to use GCmonitor) but will take time to implement. 2. Logger clash The existing GCmonitor bean access the logger early and we don't have the tomcat logger handy. Tomek is working on a solution but it will take few days to complete. Therefore, disable the JVM balloon for v0.05. Acked-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Gleb Natapov authored
Reviewed-by:
Tomasz Grabiec <tgrabiec@gmail.com> Signed-off-by:
Gleb Natapov <gleb@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Allow arbitrary predicates to be waited on. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Add sockbuf::sb_cc_wq for using instead of msleep(&sb->sb_cc). This paves the way for lockless wakeups for net channels, as the wait primitive is now thread::wait_for() instead of msleep(). In addition this reduces lock acquisition and improves netperf bandwidth by about 10%. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
This was used to ensure all socket-using code was converted to C++, but not cleaned up later. Clean it up now. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
A waitqueue is an object on which multiple threads can wait; other threads can wake up either one or all waiting threads. A waitqueue is associated with an external mutex which the user must supply for both wait and wake operations. Waitqueues differ from condition variables in three respects: - waitqueues do not contain an internal mutex. This makes them smaller, and reduces lock acquisitions. On the other hand the waker must hold the associated mutex, whereas this is not required with condition variables. - waitqueues support sched::thread::wait_for() waitqueues support wait morphing and do not cause excess lock contention, even with wake_all(). Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
This adds a facility to wake a thread, but with the intention that it will acquire a certain lock after waking, and while the waker holds the lock. This is implemented using the regular wait morphing code (send_lock() and receive_lock()), but with additional mutual exclusion to allow regular wake()s in parallel. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Add a signal catching class (signal_catcher). Use signal_catcher::wait() to wait for a signal. Use sched::thread::wait_for(..., signal_catcher&, ...) to wait for a signal in addition to other events. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Waiting is complicated; you can wait for a condition variable, a timer, wait queues and signals (when we have them), semaphores, and more. When you need to wait for multiple events, things become even more complicated as some sort of abstraction is needed. poll() for example supports waiting for multiple objects that conform to the fd interface, or for a timeout. To allow more flexible waiting, this patch adds a poll-like interface to the scheduler, except that the interfaces are all compile time. We add a new function wait_for() that accepts a variable number of waitable objects. A waitable object is an object that supports the three methods: - poll(): check if waiting is complete - arm(): prepare for waiting - disarm(): finish waiting to make a waitable object usable with wait_for, these functions have to be supplied. Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@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>
-
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
Remove the extra check on size just like the remark above implies. 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>
-
Asias He authored
The check is moved to bdev_read and bdev_write. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Asias He authored
setup_features() is called twice, once in virtio_driver constructor and once in virtio device driver constructor. Doing it in driver constructor is enough. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Asias He authored
This would be useful for device with mmio bar, e.g. AHCI controller. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
The OSv loader has a "--verbose" option to enable debug() output to be printed to the console and not just to a memory buffer. However, needing to pass this option in the "-e" string is annoying, and even worse when you want to use the default command line and didn't even want an explict "-e" option. So this patch adds a --verbose to run.py, which can be used whether or not a "-e" option is given. For example: run.py --verbose or run.py --verbose tests/tst-timerfd.so As a shorthand for --verbose, I used "-V". Unfortunately, lowercase "-v" was already taken (by the "vhost" option). Fixes #173. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
As issue #128 explains, it is annoying that once the "-e" option was used in run.py, it overrides the default command line, so that running run.py again without -e reruns the same modified command line, and not the default one as usual. This simple patch changes this behavior: On every run of run.py, the command line is set - if "-e" is given it is set to the given command line, but if "-e" is absent, the command line is reset to the default one. This is basically the behavior that people always wanted from run.py. This patch, and the behavior it performs, are much simpler than any of the alternatives proposed in issue #128. Please don't complain that this can only be used for development, and not for EC2, for creating images to distribute, and so on. After all, this is a patch to *run.py*, and it is obviously not relevant to anyone who is running an OSv image not through run.py. This patch only makes run.py more convenient to use. Fixes #128. Signed-off-by:
Nadav Har'El <nyh@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>
-
Nadav Har'El authored
sysinfo() used sizeof(struct sysinfo) to decide how many zeros to write. The problem is that our struct was much larger than Linux's (we had a much larger padding at the end), so if we run code compiled on Linux, that code would allocate a small structure on the stack and then zero a much larger structure, causing the stack to be corrupted. Drop the "reserved" field making our structure larger. It's not needed. Fixes #174. 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>
-