- Jan 22, 2014
-
-
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>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 21, 2014
-
-
Nadav Har'El authored
This patch fixes chdir() on a normal file, which used to succeed (!?), but now will fail as it should, with ENOTDIR. The patch also adds an exhaustive test for chdir's success and error cases. Before the latest chdir() patches, most of these tests would fail, and now all of them succeed. This test is standard C++ & Posix code, so it can be run also on Linux. This is important for verifing that whatever we expect from OSv, Linux really does the same. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
This patch adds the O_DIRECTORY flag to sys_open(), which causes the open to fail with ENOTDIR if the given file is any type of file but a directory. We need this flag as part of a correct implementation of chdir() (which should fail on a non-directory file), and it is also required for Linux compatibility (the O_DIRECTORY flag exists since Linux 2.1.126). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
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>
-