Skip to content
Snippets Groups Projects
  1. Apr 02, 2014
  2. Apr 01, 2014
    • Glauber Costa's avatar
      balloon: no longer make it part of the shrinker infrastructure. · 3c716bda
      Glauber Costa authored
      
      The current ballooning mechanism has a very serious design flaw, that became
      obvious once the tests with it advanced: if we wait until memory is short to
      release memory, it may be that the JVM itself may block. In particular, the
      blocking thread can be running the Garbage Collector. More likely, it can
      start running the GC to open up space for an object so big as the balloon.
      
      I don't believe this is something we should fix with a quick hack, and I am
      then pushing for a redesign: The solution is to use a reservation system, that
      works by ballooning beforehand when the amount of reserved memory goes too low.
      
      This system works by noting that when we balloon, we are effectively limiting
      the maximum amount of memory java will ever use. We already have accounts of
      both the amount of free memory and the amount of memory allocated to the heap.
      With those figures, we can easily find out when the amount of used memory +
      a full heap would go over the amount of available memory. When that happens,
      we balloon.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      3c716bda
    • Glauber Costa's avatar
      java: heuristically determine the heap regions at startup · f2d154f6
      Glauber Costa authored
      
      We can determine which mappings from the JVM are heap areas in a more
      robust way by flipping a flag when we start JVM creation, and flipping
      it back when we are finished. Doing this early is more robust and should
      work better with a bigger set of GCs.
      
      Although this is a heuristic, Calle agrees this is safe, and it has
      been tested and confirmed to work with the following options:
      
          -XX:+UseSerialGC
          -XX:+UseG1GC
          -XX:+UseParallelGC
          -XX:+UseParallelOldGC
          -XX:+UseParNewGC
          -XX:+UseConcMarkSweepGC
          -XX:+UseConcMarkSweepGC
      
      which pretty much covers all relevant GCs
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      f2d154f6
  3. Mar 25, 2014
  4. Mar 24, 2014
  5. Mar 21, 2014
  6. Mar 17, 2014
  7. Mar 06, 2014
  8. Feb 22, 2014
  9. Feb 06, 2014
    • Nadav Har'El's avatar
      Elf: Fix shared-object load concurrent with dynamic linker use · 68afb68e
      Nadav Har'El authored
      
      This patch addresses the bugs of *use* of the dynamic linker - looking
      up symbols or iterating the list of loaded objects - in parallel with new
      libraries being loaded with get_library().
      
      The underlying problem is that we have an unprotected "_modules" vector
      of loaded objects, which we need to iterate to look up symbols, but this
      list of modules can change when a new shared object is loaded.
      
      We decided *not* to solve this problem by using the same mutex protecting
      object load/unload: _mutex. That would make boot slower, as threads using
      new symbols are blocked just because another thread is concurrently loading
      some unrelated shared object (not a big problem with demand-paged file
      mmaps). Using a mutex can also cause deadlocks in the leak detector,
      because of lock order reversal between malloc's and elf'c mutexes: malloc()
      takes a lock first and then backtrace() will take elf's lock, and on the
      other hand elf can take its lock and then call malloc taking malloc's lock.
      
      Instead, this patch uses RCU to allow lock-free reading of the modules
      list. As in RCU, writing (adding or removing an object from the list)
      manufactures a new list, defering the freeing of the old one, allowing
      reads to continue using the old object list.
      
      Note that after this patch, concurrent lookups and get_library() will
      work correctly, but concurrent lookups and object *unload* still will
      still not be correct because we need to defer an object's unloading from
      memory while lookups are in progress. This will be solved in a following
      patch.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      68afb68e
  10. Feb 02, 2014
  11. Jan 27, 2014
  12. Jan 22, 2014
  13. Jan 20, 2014
  14. Jan 19, 2014
  15. Jan 17, 2014
  16. Jan 16, 2014
    • Nadav Har'El's avatar
      Fix regression in early output to stdout · 5d9e5e7c
      Nadav Har'El authored
      
      Output to stdout normally goes to file descriptor 1. However, during
      early boot, before the console is opened on file descriptor 1, we also
      want printf() to work. So this case is specially treated in
      libc/stdio/__stdout_write.cc, where in this early case, we used debug_write
      directly, instead of write to the file descriptor.
      
      However, recent patches changed debug_write to write to a memory buffer,
      instead of to screen (unless "--verbose" option is given to the loader).
      This made early printf() break too.
      
      This patch changes __stdout_write to use console::write(), not
      debug_write(). To use console::write(), I had to convert that source
      file to C++.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      5d9e5e7c
  17. Jan 15, 2014
  18. Jan 13, 2014
Loading