Skip to content
Snippets Groups Projects
  1. Feb 10, 2014
  2. Feb 09, 2014
  3. Feb 07, 2014
    • Zhi Yong Wu's avatar
      build: ignore the changes in submodules · cd79456a
      Zhi Yong Wu authored
      
      When we commit the changes in osv.git, we usually make a mistake to
      also commit the changes in the submodules. To avoid this, this patch
      is trying to add "ignore = all" to .gitmodules file.
      
      Signed-off-by: default avatarZhi Yong Wu <zwu.kernel@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      cd79456a
    • Nadav Har'El's avatar
      mempool: Don't waste 8MB of memory on unused buffers · 60319ba7
      Nadav Har'El authored
      
      This patch reduces our BSS size from 9MB to less than 1MB, and reduces the
      minimum amount of memory required to run the "rogue" image from 55 MB to
      just 47 MB.  Together with the previous patch, this fixes #96.
      
      Our almost-lock-free SMP allocator uses cpu-to-cpu rings to send freed
      memory from one CPU to another. So for N cpus we need N^2 of these buffers.
      But in an apparent attempt to support CPU hotplugging  the current code
      allocated queues for 64 CPUs, instead of the real number of CPUs we have.
      So even with a single CPU, we always have 64*64 of these buffers, each a
      little over 2K, so totaling a whopping 8MB, wile only a tiny fraction of
      this will ever be used
      
      This patch changes the code to only allocate the number of these queues we
      really need. It does not support CPU hot-plugging, but a lot of other places
      in the code don't support hot-plugging either, so I left a FIXME to remind
      us where we need to fix.
      
      Reviewed-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      60319ba7
    • Zhi Yong Wu's avatar
    • Nadav Har'El's avatar
      modules: Add "provides" feature · 58bead6d
      Nadav Har'El authored
      
      I recently added (thanks to Gleb!) the "openjdk8" module, which provides
      Java 8. However, when one hopes to get a shell with OpenJDK8, using:
      
      	make image=openjdk8,mgmt.shell
      
      The mgmt.shell requires the "java" module, and we end up using both
      the "java" and "openjdk8" modules.
      
      This simple patch allows openjdk8's module.py to say:
      
      	provides = ['java']
      
      Which means that any later-loaded module which does require('java')
      will *not* load the "java" module because opendjk8 claims it already
      provides it.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      58bead6d
    • Tomasz Grabiec's avatar
      apps: move submodule head · b010973e
      Tomasz Grabiec authored
      
      Tomek says:
      
      commit 3617c691709e6bdefc19dea9a6604debe9f492f3
      Author: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
      
          tomcat: set logging properties on app level.
      
      commit 27e967aace63133abb80c660202f65dae422cd7a
      Author: Nadav Har'El <nyh@cloudius-systems.com>
      
          openjdk8: provide "java"
      
      commit 428b94d1617fbaf413f427bab5e73b66342dbef8
      Author: Nadav Har'El <nyh@cloudius-systems.com>
      
          Add "openjdk8" module
      
      commit 0fe978a87d3a7c6a59e84fc9b1d77fe8c5771ebd
      Author: Avi Kivity <avi@cloudius-systems.com>
      
          Add iperf module
      
      Nadav also writes:
      
      The openjdk8 "provides" java, meaning that other modules which need java
      will be statisfied with openjdk8 instead. This means one can simply do
      
              make image=openjdk8,mgmt.shell
      
      To get the Crsh shell running on OpenJDK 8, instead of our default OpenJDK 7.
      Doing
              make image=mgmt.shell
      will continue to use our default OpenJDK 7.
      
      NOTE: Since OpenJDK 8 has not yet been officially released, the openjdk8
      module fetches the latest OpenJDK sources (from their hg repository),
      and compiles them. This is a very lengthy process, and requires quite a few
      esoteric development packages (e.g., various X-Windows header files) to
      be installed on the build machine. So the compilation is unlikely to
      succeed on the first attempt - and is not to be attempted by the faint of
      heart ;-) Also note that currently one needs to do
              cd apps/openjdk8; ./GET
      to get and compile the sources (I didn't put a Makefile to cause this
      to happen automatically)
      
      Thanks to Gleb for the script to compile OpenJDK 8.
      
      Fixes #193.
      
      Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      b010973e
    • Nadav Har'El's avatar
      Elf: Use abort(...) in elf.cc abort message · f48a16ec
      Nadav Har'El authored
      
      Ever since debug() defaults to putting the message in memory, not on the
      console, it is not useful to call debug() before abort.
      Need to pass the message to abort() itself, and it will do the right
      thing (TM).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      f48a16ec
    • Nadav Har'El's avatar
      elf: more informative exception from program::lookup_function · 5a60accd
      Nadav Har'El authored
      
      When program::lookup_function (used, for example, in our java.cc) can't
      find the function it throws an std::runtime_error exception.
      It used the not-very-useful message "symbol not found". This patch
      adds the symbol's demangled name, so if this exception is printed (e.g.,
      when not caught), we get a more informative message.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      5a60accd
    • Pekka Enberg's avatar
      Merge branch 'boot-time-measurement' · d4a16108
      Pekka Enberg authored
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      
      Conflicts:
      	loader.cc
      d4a16108
    • Glauber Costa's avatar
      loader: add a bootchart option. · 2209c95a
      Glauber Costa authored
      
      When booting with --bootchart, OSv will print a summary of where is our boot
      time being spent up to the point right before our execution of main.
      
      This mechanism can be extended later to keep measuring it later using other
      facilities to account for the application, etc.
      
      Example output:
      
      OSv v0.05-156-gd3918a1
          disk read (real mode): 132.94ms, (+132.94ms)
          .init functions: 146.10ms, (+13.16ms)
          SMP launched: 147.57ms, (+1.47ms)
          RCU initialized: 150.61ms, (+3.04ms)
          VFS initialized: 154.08ms, (+3.46ms)
          Network initialized: 160.79ms, (+6.71ms)
          pvpanic done: 162.31ms, (+1.52ms)
          pci enumerated: 171.45ms, (+9.14ms)
          drivers probe: 171.46ms, (+0.02ms)
          drivers loaded: 182.52ms, (+11.06ms)
          ZFS mounted: 2116.32ms, (+1933.80ms)
          Total time: 2116.70ms, (+0.38ms)
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      2209c95a
    • Glauber Costa's avatar
      boot: take early timings · d38883fa
      Glauber Costa authored
      
      In the past, we have struggled with long delays while reading data from disk in
      real mode, leading to big boot times (not that they are totally gone). For that
      reason, it is useful to know how much time is being spent in that process.  As
      unstable and broken the TSC is, it is pretty much our only ally for that.
      
      What I am proposing in this patch, is that we take timings from key states of
      the bootloader, and pass that to main loader. We will do that by adding some
      space at the end of the multiboot_info structure, so that we can pass some
      fields to it. Right now, we are using 16 bytes so we can pass 2 64-bit tsc
      reads.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      d38883fa
    • Glauber Costa's avatar
    • Glauber Costa's avatar
      general infrastructure for boot time calculation · 3ab3a6bb
      Glauber Costa authored
      
      I am proposing a mechanism here that will allow us to have a better idea about
      how much time do we spend booting, and also how much time each of the pieces
      contribute to. For that, we need to be able to get time stamps really early, in
      places where tracepoints may not be available, and a clock most definitely
      won't.
      
      With my proposal, one should be able to register events. After the system
      boots, we will calculate the total time since the first event, as well as the
      delta since the last event. If the first event is early enough, that should
      produce a very good picture about our boot time.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      3ab3a6bb
    • Glauber Costa's avatar
      pvclock: reuse pvclock's functionality to convert tsc to nano · 2df3c029
      Glauber Costa authored
      
      This patch provides a way to, given a measurement from tsc, acquire a nanosecond
      figure. It works only for xen and kvm pvclocks, and I intend to use it for acquiring
      early boot figures.
      
      It is possible to measure the tsc frequency and with that figure out how to
      convert a tsc read to nanoseconds, but I don't think we should pay that price.
      Most of the pvclock drivers already provide that functionality, and we are not
      planning that many users of that interface anyway.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      2df3c029
    • Raphael S. Carvalho's avatar
    • Raphael S. Carvalho's avatar
      vfs/zfs: Sync vnode and znode refcounts · ca805bdb
      Raphael S. Carvalho authored
      
      The mismatch between vnode and znode refcount was found while working on
      the leak series, but I wasn't able to come up with a good solution at
      that time.
      
      This patch addresses a problem which could potentially leak znode objects.
      
      The function vrele from the VFS layer along with the changes made into
      zfs_inactive prevent zfs_inactive itself from working properly on the
      same znode more than once. Simply put, zfs_inactive isn't able to release
      more than 1 refcnt of the same znode.
      
      So the actual problem comes into effect, when you have a znode holding
      two refcounts of its own. When it happens, the underlying znode object
      would stay around 'forever' ( at least till OSv is switched off ;-) )
      
      - Scenario example where this problem would take place:
      
      * Consider that you have opened a file for the link A, so the znode structure
      will be created with refcnt set to 1.
      
      * Afterwards, you open a file for the link B which has the same inode as the
      link A. Another znode wouldn't be created, but instead the refcnt of the same
      znode used for the link A would be bumped, thus 2.
      
      - How to fix the problem:
      
      * First, allow zfs_inactive to work on the same znode till the refcnt reaches
      zero. To do that, vp->vdata must only be set to NULL when we're sure that
      znode will be actually destroyed. So let's do it conditionally regarding
      the znode refcnt from now on.
      NOTE: also properly initialize the field z_vnode on every znode creation.
      
      * Then finally, fix our vrele to call VOP_INACTIVE even when the vnode object
      isn't supposed to be destroyed. So it would release the refcnt of the znode
      properly. After all, zfs_zinactive called by zfs_inactive would only destroy
      the znode object if its refcnt reaches 0.
      It would also synchronize the vnode refcnts with the znode ones.
      
      'scripts/test.py -s;' succeeded.
      
      Reviewed-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      ca805bdb
    • Nadav Har'El's avatar
      elf: do not access objects with preemption disable · 1dc81fe5
      Nadav Har'El authored
      
      program::lookup and program::lookup_addr were written for optimal
      performance and look-freedom by using the RCU lock to protect the short
      module iteration. However, with demand-paged file mapping, the actual
      objects are demand-page, and we cannot assume that object memory can be
      read without sleeping.
      
      So switch these functions to use with_modules, the more general, and
      somewhat slower, technique to iterate over modules. With with_modules,
      the RCU lock is only used to copy the list of modules, and the protection
      against the individual modules being deleted is done separately (by
      incrementing a reference count preventing any module from being deleted).
      
      This makes symbol lookup a bit slower, but symbol lookups are relatively
      infrequent (usually occur during early application startup, the first time
      each symbol is used), and measuring Java's startup time, as an example,
      I didn't see any measureable slowdown.
      
      Fixes #169.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      1dc81fe5
  4. Feb 06, 2014
Loading