- Oct 10, 2013
-
-
Avi Kivity authored
We have _KERNEL defines scattered throughout the code, which makes understanding it difficult. Define it just once, and adjust the source to build. We define it in an overridable variable, so that non-kernel imported code can undo it.
-
- Oct 08, 2013
-
-
Nadav Har'El authored
Some trivial changes to tst-loadbalance.so. In particular, this benchmark assumes it is run on two cpus, so don't do anything if that isn't true. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 07, 2013
-
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Make mincore() error-path compatible with Linux by requiring 'addr' to be page aligned. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Linux requires mincore() addresses to be page aligned. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Fix tst-mmap test on Linux by passing MAP_PRIVATE as a mmap flag. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
The mmap() function returns MAP_FAILED on error. Test for that. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Use C++ APIs to remove dependency to OSv internals so that we can run the same test on Linux. Make the concurrency tests depend on OSv because C++ doesn't have a API for binding threads to specific CPUs and we don't want to clutter the test with pthread'isms. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 03, 2013
-
-
Yang Bai authored
Allow specify test names to testrunner such as testrunner.so tst-foo1.so tst-foo2.so to run tst-foo1 and tst-foo2 only in the order they are specified. This does not change the default behavior that cmdline=testrunner.so will run all tests under /tests dir. This change can help developer to run the only test cases they need quickly to verify new feature or find possible regressions. Signed-off-by:
Yang Bai <hamo.by@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 29, 2013
-
-
Nadav Har'El authored
This patch adds support for the Linux kill(2) function. The next patch will add alarm(2) support, which uses kill(2). To be honest, we sort-of implement kill(). This implementation is compatible with the API, but the semantics are somewhat different: While in Linux kill() causes the signal handler to run on one of the existing threads, in this implementation, the signal handler is run in a *new* thread. Implementing the exact Linux semantics in OSv would require tracking when OSv runs kernel code (i.e., code in the main executable, not a shared object) so we can delay running the signal handler until returning to the user code. Moreover, we'll need to be able to interrupt sleeping kernel code. This is complicated and adds overhead even if signals aren't used (and they aren't used in most modern code). I expect that this code will be "good enough" in many use cases. This code will *not* be good in enough in programs that expect one of the following: 1. A program that by using Posix Thread's "signal masks" tried to ensure that the signal is delivered to one specific thread, and not to an arbitrary thread. 2. A program that used kill() or alarm() not intending to run a signal handler, but rather intending to interrupt a sleeping system call like sleep() or read(). Our kill() does not interrupt sleeping OSv function calls, which will continue to sleep on the thread they run on. The support in this patch (and see next patch, for alarm()) is good enough for netperf's use of alarm(). P.S. kill() can be used only to send a signal to the current process, the only process we have in OSv (you can also use pid=0 and pid=-1 to achieve the same results). This patch also adds a test for kill() and alarm(). The alarm() test will fail until the next patch :-) Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Sep 26, 2013
-
-
Pekka Enberg authored
Check that link returns EEXIST if destination exists. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Check that link returns ENOENT if source does not exist. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Make the link source and target paths configurable so the test can be run on Linux: $ g++ -std=c++11 tst-fs-link.cc && ./a.out foo foo2 Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Add a new test to see if the content from one link would be the same in another. Signed-off-by:
Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add a basic test case for filesystem hard link support. You can run it as follows: ./scripts/run.py -e "tests/tst-fs-link.so" Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 24, 2013
-
-
Nadav Har'El authored
Coverity thinks we have a use-before-assigned of r2 here, despite the join(), so let's just move the test inside the thread to make this warning go away. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Nadav Har'El authored
We used to return the POLLRDHUP event when polling a write-side of a pipe whose reader is closed, but Linux returns POLLERR|POLLOUT, so let's do the same. Linux's behavior can be explained in that when the reader is closed, a write will return immediately (and hence POLLOUT) but moreover, will return with an error (EPIPE). And since a read will also cause an error (EBADF when reading on the write side of the pipe), a POLLERR makes sense and says that any operation on this fd will now result in an error. This patch also adds a test for this case. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Nadav Har'El authored
The code in pipe_buffer.cc had the meaning of POLLHUP and POLLRDHUP reversed, and as a result POLLHUP wasn't correctly returned when polling a read-end of the pipe whose write-end is closed. This fixes the mixup, and as a result the test added to tst-pipe.cc in the previous commit, and also another one added in this patch, all pass. We are still incompatible with Linux with what we do regarding POLLRDHUP. This will be a separate patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Nadav Har'El authored
Our poll_wake() code ignored calls with the POLLHUP event, because the user did not explicitly ask for this event. This causes a poll() waiting on read from a pipe whose write side closes not to wake up. This patch adds a test for this case in tst-pipe.cc, and fixes the bug by adding to the poll structure's _events also ~POLL_REQUESTABLE, i.e., any bits which do not have to be explicitly requested by the user (POLL_REQUESTABLE is a new macro defined in this patch). After this patch, poll() wakes as needed in the test (instead of just hang), but returns the wrong event because of another bug which will be fixed in a separate patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Sep 20, 2013
-
-
Nadav Har'El authored
Add a trivial sleep() test, which sleep()s for 2 seconds, and verifies that this finishes and has slept for roughly 2 seconds. I used this for debugging issue #26 - the attempts there ruined timers, and in particular this trivial test hangs, as sleep() never returns. (A note to our future automatic testing implementor: We need to allow for the possibility that a test doesn't cleanly fail, but rather hangs, and consider this a failure too). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Sep 19, 2013
-
-
Benoît Canet authored
This regression test trigger issue #8 "Make Java InetAddress.getHostName() work" by exercising the DNS resolver on localhost and a dns root server. The test takes care of specifying NI_NOFQDN to resolve only the hostname part of localhost ip. It appears that the DNS ip is not communicated to the libc by core/dhcp.cci: /etc/resolv.conf is not filled. Test contributed while waiting for an fix idea to implement. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 15, 2013
-
-
Nadav Har'El authored
Add Cloudius copyright statements to our tests (C++ and Java code).
-
- Sep 12, 2013
-
-
Guy Zana authored
-
Nadav Har'El authored
This is a test for the effectiveness of our scheduler's load balancing while running several threads on several cpus. A full description of the test and its expected results is included in comments in the beginning of the code. but briefly, the test runs multiple concurrent busy-loop threads, and an additional "intermittent" thread (one that busy-loops for a short duration, and then sleeps), and expects that all busy threads will get their fair share of the CPU, and the intermittent thread won't bother them too much. Testing the current code, this tests demonstrates the following problems we have: 1. Two busy-loop threads on 2 cpus are 5%-10% slower than just one. This is not kernel overhead (profiling show 100% of the time in the test's inner loop), and I see exactly the slowdown when running this test on the Linux host, so it might be related to the host's multitasking? For now, let's not worry about that. 2. Much more worrying is that the intermittent thread sometimes (in about half the tests) causes us to only fully use one CPU, and of course get bad performance. 3. In many of the tests involving more than 2 threads (2 threads + intermittent, or 4 threads) load balancing wasn't fair and some threads got more CPU than the others. Later I'll send patches to fix issues 2 and 3, which appear to happen because the load balancer thread doesn't run as often as it should, because of vruntime problems.
-
- Sep 08, 2013
- Sep 02, 2013
-
-
Pekka Enberg authored
Add simple tests for munmap() for file-backed memory maps. This exposes a limitation in munmap() not writing out MAP_SHARED mappings.
-
- Aug 27, 2013
-
-
Nadav Har'El authored
Unlike msync(), mincore() should also work on non-mmapped memory, such as stack and malloc()ed memory. Currently it doesn't - it fails on malloc()ed memory and only sometimes works on stacks (works on pthread stacks which are mmapped, but not on sched::thread stacks which are malloced by default). This patch adds a test to tst-mmap.cc to demonstrate this problem. The test currently fails, will be fixed in a follow-up patch.
-
- Aug 26, 2013
-
-
Nadav Har'El authored
sched.hh included elf.hh, just so it can refer to the elf::tls_data type. But now that we have rcu.hh which includes sched.hh and therefore elf.hh, if we wish to use rcu in elf.hh (we'll do this in a later patch), we have an include loop mess. So better not include elf.hh from sched.hh, and just declare the one struct we need. After sched.hh no longer includes elf.hh and the dozen includes that it further included, we need to add missing includes to some of the code that included sched.hh and relied on its implict includes.
-
Pekka Enberg authored
The ASSERT() doesn't compile if ZFS debugging is enabled: CC tests/tst-zfs-disk.o In file included from ../../bsd/sys/cddl/compat/opensolaris/sys/debug.h:35:0, from ../../bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h:42, from ../../tests/tst-zfs-disk.c:28: ../../tests/tst-zfs-disk.c: In function ‘make_vdev_root’: ../../tests/tst-zfs-disk.c:119:9: error: ‘t’ undeclared (first use in this function) ASSERT(t > 0); ^ ../../bsd/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h:56:29: note: in definition of macro ‘ASSERT’ #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__))) ^ ../../tests/tst-zfs-disk.c:119:9: note: each undeclared identifier is reported only once for each function it appears in ASSERT(t > 0); ^ ../../bsd/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h:56:29: note: in definition of macro ‘ASSERT’ #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__))) ^
-
- Aug 16, 2013
-
-
Christoph Hellwig authored
These aren't used in the build and will bitrot badly once changing the VFS significantly.
-
- Aug 12, 2013
-
-
Avi Kivity authored
Reduce memory consumption so we can test in a 1GB guest.
-
Avi Kivity authored
The test tries to acquire the write lock while the read lock is taken in the same thread, which deadlocks. Remove the deadlocking construct.
-
Avi Kivity authored
taskqueue_thread_enqueue expects a pointer to a pointer to the taskqueue as context, give it that.
-
Avi Kivity authored
-
Avi Kivity authored
-
- Aug 06, 2013
-
-
Christoph Hellwig authored
-
Nadav Har'El authored
The previous commit (fix symbol resolution order) caused a regression - tst-pipe.so stopped working, aborting on segfault while handling an expected exception (one of the only places in OSV where we use an exception to signal an error - running out of file descriptors). However, it turns that commit just exposed an already existing bug in our exception unwinding support. The following trivial test of exceptions, throwing an integer and catching it, crashes both with the previous commit, and without it.
-
- Aug 05, 2013
-
-
Nadav Har'El authored
Christoph discovered a bug in our dynamic linker, where symbols which exist in the kernel cannot be used in a shared object, which can cause nasty bugs when trying to run existing programs. This test demonstrates this bug, and verifies its fix (in the previous commit).
-
Christoph Hellwig authored
Without this we somehow get a non-zero value in it while running under OSv. This needs to be investigated as it would have a bad effect on user workloads.
-