- Feb 06, 2014
-
-
Nadav Har'El authored
When running a command in the background, do_main_thread() passes the command line in a std::vector pointer to a new pthread. Unfortunately, soon afterwards the vector can go out of scope and the result is a crash. Fix this oversight. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
This patch registers the ARC shrinker by using the event handler list from BSD side. When ARC is initialized, it inserts the lowmem event handler into an external event handler list. lowmem basically signals the reclaiming thread which will then wake up to decide which approach should be used to shrink the ARC. The memory pressure on OSv is activated when the 20% watermark is reached, so the shrink policy will decide which shrinker should be called on such events. bsd_shrinker_init is the responsible to find the lowmem event handler from the external list, and integrate it into our shrinker infrastructure. arc_lowmem needed few changes to return the amount of released memory from the ARC. Glauber and I tested the functionality by filling up the ARC up to its target, then allocating as much memory as possible to see if the ARC shrinker would take place to release memory back to the operating system. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Takuya ASADA authored
Signed-off-by:
Takuya ASADA <syuu@cloudius-systems.com> 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
Several source files include <drivers/clockevent.hh>, though this is a very low-level feature which they don't actually use. sched.cc does use <drivers/clockevent.hh>, but already gets it through sched.hh, so also doesn't need to include it explicitly. This patch removes the unnecessary includes. 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
-
-
Nadav Har'El authored
Our loader's command line (what is given to the "-e" option of run.py) already allows running multiple commands (each a shared object with arguments) separated with a semicolon - e.g., run.py -e "program1.so; program2.so; program3.so" This patch allows, just like in Unix, to use a "&" instead of a ";", in which case the preceding program is run in the background, in our case this means in a new thread. For example, run.py -e "httpserver.so& java.so ..." As before a command line can constitute multiple commands, and whitespaces around the separators (; or &) are optional. Take care if you intend to run the *same* object multiple times concurrently, e.g., "something.so& something.so". For an object to support this use case, it should support its main() being called in parallel, and in particular avoid using global variables. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> 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>
-
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
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>
-
- Jan 16, 2014
-
-
Pekka Enberg authored
Remove the copyright statement from boot log but keep the OSv version banner there to tidy up boot. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Since recently, debug() messages are by default not visible. This means they are not a good way to print error messages :-) This patch fixes two error messages from loader.cc, that were no longer visible. For example, "scripts/run.py -e xyz" completed without any message instead of telling the user that "xyz" doesn't exist. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 15, 2014
-
-
Eduardo Piva authored
Add --verbose options to OSv, so it will flush buffer after handling the kernel option and set verbose boolean flag in debug code. Signed-off-by:
Eduardo Piva <efpiva@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 10, 2014
-
-
Nadav Har'El authored
When trying to run a nonexistant program, e.g., "run.py -e xyz", sometimes (especially in a debug build) we would see the spurious message: program xyz returned -16384 The bug is simple: when osv::run returns null, meaning the program was not found, it does not set the "ret" value. Our code checked if ret!=0 before checking if osv::run actually found the program, which is wrong. Simply changing the order of the code solves this bug. Fixes #156. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Takuya ASADA authored
Add --vga on cmdline, to switch vga console. 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>
-
Pekka Enberg authored
It's 2014 now. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Jan 02, 2014
-
-
Tomasz Grabiec authored
In order to reuse the logic it needs to be extracted. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 27, 2013
-
-
Vlad Zolotarov authored
Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 20, 2013
-
-
Raphael S. Carvalho authored
Currently, library objects are being leaked by run_main() on success of osv::run() which, in addition to leaking memory, makes the dcache leak directory entries that causes further problems. Releasing library objects is fine as even dependent objects will be released automatically. I have tested it, and dcache hasn't any leaked dentries anymore. This problem was found in our attempt to implement dentry hierarchy with help for Avi Kivity. Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Reviewed-by:
Asias He <asias@cloudius-systems.com> [ penberg: improve changelog ] Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_rng driver. Change the naming from virtio::virtio_rng to virtio::rng. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_net driver. Change the naming from virtio::virtio_net to virtio::net. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 19, 2013
-
-
Asias He authored
We are under the virtio namespace, it makes no sense to repeat the virtio prefix again in the virito_blk driver. Change the naming from virtio::virtio_blk to virtio::blk. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 18, 2013
-
-
Asias He authored
This adds initial virtio-scsi support. We have no scsi layer in osv, in this implementation virtio-scsi works directly with the bio layer. It translates BIO_READ, BIO_WRITE and BIO_FLUSH to SCSI CMD. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 17, 2013
-
-
Nadav Har'El authored
While booting with many cpus (e.g., run.py -c 20, but I sometimes saw this with as few as 7), we crashed while trying to sleep with preemption disabled: Assertion failed: preemptable() (/home/nyh/osv/include/sched.hh: do_wait_until: 605) Aborted Turns out that since commit 223b2252 (half a year ago), main_cont() ran smp_launch() with preemption disabled. But smp_launch creates threads, and thread's constructor may sleep (e.g., on the thread_list_mutex), and we cannot do this with preemption disabled... So dropped the preempt_disable()/enable() from main_cont(). The reasoning for it as expressed in 223b2252 appears to be no longer relevant. Fixes #130. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 11, 2013
-
-
Pekka Enberg authored
There's no reason to run a locale test as part of OSv boot sequence... Avi writes: It used to be a major stumbling block but is of no interest now. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Amnon Heiman authored
Separate /dev/random the virtio-rng driver and register virtio-rng as a HW RNG entropy source. Signed-off-by:
Amnon Heiman <amnon@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 06, 2013
-
-
Glauber Costa authored
KVM always have a network interface provided by QEMU, Xen not necessarily so. I fixed this before, but it was probably broken by the multiple interfaces work. The interface list is not a C++ structure, so the easiest way to handle that is to keep track of whether or not we have any non-loopback interface. (No need to know how many). If we don't, skip DHCP startup. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Benoît Canet authored
The exact location of the stack end is not needed by java so move back this variable to restore the state to what was done before the mkfs.so/cpiod.so split. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 05, 2013
-
-
Benoît Canet authored
This restore the original behavior of osv::run in place before the mkfs.so and cpiod.so split committed a day ago. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Reviewed-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 03, 2013
-
-
Benoît Canet authored
A ';' at the end of a parameter mark the end of a program's arguments list. The goal of this patch is to be able to split mkfs.so in to parts mkfs.so and cpiod.so. The patch uses a full spirit parser to escape "" and split commands around ';'. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Make sure ZFS intention log is flushed to disk by unmounting rootfs at poweroff. Fixes #108. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 01, 2013
-
-
Pekka Enberg authored
This adds the virtio-rng driver to OSv. The implementation is simple: - Start a thread that keeps 64 byte of entropy cached in internal buffer. Entropy is gathered from the host with virtio-rng. - Create device nodes for "/dev/random" and "/dev/urandom" that both use the same virtio_rng_read() hook. - Use the entropy buffer for virtio_rng_read(). If we exhaust the buffer, wake up the thread and wait for more entropy to appear. We eventually should move device node creation to separate drivers/random.c that multiplexes between different hardware RNG implementations. However, as we only support virtio-rng, I'm leaving that to whomever implements support for the next RNG. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
Before this patch, OSv crashes or continuously reboots when given unknown command line paramters, e.g., scripts/run.py -c1 -e "--help --z a" With this patch, it says, as expected that the "--z" option is not recognized, and displays the list of known options: unrecognised option '--z' OSv options: --help show help text --trace arg tracepoints to enable --trace-backtrace log backtraces in the tracepoint log --leak start leak detector after boot --nomount don't mount the file system --noshutdown continue running after main() returns --env arg set Unix-like environment variable (putenv()) --cwd arg set current working directory Aborted The problem was that to parse the command line options, we used Boost, which throws an exception when an unrecognized option is seen. We need to catch this exception, and show a message accordingly. But before this patch, C++ exceptions did not work correctly during this stage of the boot process, because exceptions use elf::program(), and we only set it up later. So this patch moves the setup of the elf::program() object earlier in the boot, to the beginning of main_cont(). Now we'll be able to use C++ exceptions throughout main_cont(), not just in command line parsing. This patch also removes the unused "filesystem" paramter of elf::program(), rather than move the initializion of this empty object as well. Fixes #103. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
During boot, between the time main() set the IDT and when later smp_launch() is called, the IDT doesn't actually work correctly. The problem is that we use the separate stacks feature (IST), and that doesn't work without also setting the GDT, not only the IDT. So use init_on_cpu() to initialize not only the IDT, but other stuff as well. Fix smp_launch() not to repeat this initialization on the boot CPU, as it was already done. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-