Skip to content
Snippets Groups Projects
  1. Dec 30, 2013
  2. Dec 27, 2013
  3. Dec 25, 2013
  4. Dec 24, 2013
    • Nadav Har'El's avatar
      sched: Overhaul sched::thread::attr construction · eb48b150
      Nadav Har'El authored
      
      We use sched::thread::attr to pass parameters to sched::thread creation,
      i.e., create a thread with non-default stack parameters, pinned to a
      particular CPU, or a detached thread.
      
      Previously we had constructors taking many combinations of stack size
      (integer), pinned cpu (cpu*) and detached (boolean), and doing "the
      right thing". However, this makes the code hard to read (what does
      attr(4096) specify?) and the constructors hard to expand with new
      parameters.
      
      Replace the attr() constructors with the so-called "named parameter"
      idiom: attr now only has a null constructor attr(), and one modifies
      it with calls to pin(cpu*), detach(), or stack(size).
      
      For example,
          attr()                                  // default attributes
          attr().pin(sched::cpus[0])              // pin to cpu 0
          attr().stack(4096).pin(sched::cpus[0])  // pin and non-default stack
          and so on.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      eb48b150
  5. Dec 23, 2013
    • Asias He's avatar
      tests: Wait until all bio are done in bdev-write test. · 08f353e6
      Asias He authored
      
      I saw this Abort:
      
      35.159 Mb/s
      50.230 Mb/s
      46.648 Mb/s
      68.850 Mb/s
      Wrote 613.418 MB in 10.00 s
      Aborted
      
      The backtrace says:
      
        (gdb) bt
        #0  0x000000000035bb82 in halt_no_interrupts () at
        /home/asias/src/cloudius-systems/osv/arch/x64/processor.hh:241
        #1  osv::halt () at
        /home/asias/src/cloudius-systems/osv/core/power.cc:28
        #2  0x0000000000218142 in abort (msg=msg@entry=0x55197f "Aborted\n") at
        /home/asias/src/cloudius-systems/osv/runtime.cc:89
        #3  0x000000000021816e in abort () at
        /home/asias/src/cloudius-systems/osv/runtime.cc:79
        #4  0x000000000039eaa2 in osv::generate_signal (siginfo=...,
        ef=0xffffc0003eb56008) at
        /home/asias/src/cloudius-systems/osv/libc/signal.cc:58
        #5  0x000000000039eb0c in osv::handle_segmentation_fault
        (addr=<optimized out>, ef=<optimized out>) at
        /home/asias/src/cloudius-systems/osv/libc/signal.cc:73
        #6  0x000000000030b45c in mmu::vm_sigsegv
        (addr=addr@entry=17592186060800, ef=ef@entry=0xffffc0003eb56008) at
        /home/asias/src/cloudius-systems/osv/core/mmu.cc:763
        #7  0x000000000030b54b in mmu::vm_fault (addr=<optimized out>,
        addr@entry=17592186061840, ef=ef@entry=0xffffc0003eb56008)
            at /home/asias/src/cloudius-systems/osv/core/mmu.cc:773
        #8  0x000000000032bff5 in page_fault (ef=0xffffc0003eb56008) at
        /home/asias/src/cloudius-systems/osv/arch/x64/mmu.cc:35
        #9  <signal handler called>
        #10 0x0000100000004410 in ?? ()
        #11 0x000000000031e5fd in virtio::blk::req_done
        (this=0xffffc0003eddb800) at
        /home/asias/src/cloudius-systems/osv/drivers/virtio-blk.
      
      Wait until all the bio are done to fix this use after free.
      
      This patch also make the test to measure completed writes instead of
      submitted writes.
      
      Reviewed-by: default avatarTomasz Grabiec <tgrabiec@gmail.com>
      Signed-off-by: default avatarAsias He <asias@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      08f353e6
  6. Dec 20, 2013
  7. Dec 17, 2013
  8. Dec 16, 2013
  9. Dec 13, 2013
  10. Dec 12, 2013
    • Vlad's avatar
      compilation: Fix compilation errors · 6f3a966a
      Vlad authored
      
      Fix some compilation errors that would arrise when NDEBUG is defined:
       - tests/misc-tcp.cc: missing #include<iostream> that would come from
         include/boost/assert.hpp: line 81 when NDEBUG is not defined.
       - bsd/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c:
         when NDEBUG is not defined assert() is defined to __assert_fail,
         which has "noreturn" attribute, which satisfies the compiler.
         When NDEBUG is defined and assert() completly compiles out, the
         compiler start complaining about the missing "return" statment.
      
      Signed-off-by: default avatarVlad Zolotarov <vladz@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      6f3a966a
  11. Dec 11, 2013
    • Raphael S. Carvalho's avatar
    • Nadav Har'El's avatar
      Rename blacklisted tests · 4e4e191f
      Nadav Har'El authored
      
      Rename blacklisted tests, from tst-wake.cc et al. to misc-wake.cc.
      
      The different name will cause these tests not to be automatically run
      by "make check" - without needing the separate blacklist in test.py
      (which this patch deletes).
      After this patch, testrunner.so will also only run tests called tst-*,
      so will not run the misc-* tests.
      
      The misc-* tests can still be run manually, e.g.,
        run.py -e tests/misc-mutex.so
      
      In addition to the previously blacklisted tests, this patch "blacklists"
      (renames) a few additional tests which fail quickly, but test.py didn't
      know because they didn't use the word "fail". An example is tst-schedule.so,
      which existed immediately when not run on 1 vcpu. So this patch also
      renames it to misc-schedule.so, so "make check" or testrunner.so won't
      run this test.
      
      Note that after this patch, testrunner.so is a new way to run all tests,
      but it isn't working well yet because it still exposes new bugs that do not
      exist in the separate tests (depending on your view point, this might be
      considered a feature, not a bug, in testrunner.so...).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      4e4e191f
    • Pekka Enberg's avatar
      tst-fs-link.so: Use mktemp() for path names · df4a7bd2
      Pekka Enberg authored
      
      Using hard-coded path names is problematic because other test cases may
      use the same path names and forget to clean up after them.
      
      Make tst-fs-link.so more robust by using mktemp() to generate unique
      path names.
      
      Reviewed-by: default avatarTomasz Grabiec <tgrabiec@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      df4a7bd2
    • Glauber Costa's avatar
      tests: fix threads being destroyed earlier. · b0dc3f1a
      Glauber Costa authored
      
      The last part of the standard thread tests created 4 threads and calls the
      detach of one from the body of the other. They live in the same block to
      guarantee that they will all be destroyed more or less at the same time (we
      expect). Avi, however, demonstrated that a mistake prevents that from being
      the actual case:
      
          t1 starts to run
          t2 starts to run
          t3 starts to run
          t4 starts to run
          t4 is detached
          t4 is destroyed (ok)
          t3 is destroyed. wasn't detached or join, to terminate
          t1, t2, t3 are detached, but too late
      
      This introduces a simple wait mechanism to avoid having the threads
      terminated after the block is gone.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      b0dc3f1a
  12. Dec 10, 2013
  13. Dec 09, 2013
  14. Dec 08, 2013
  15. Dec 06, 2013
  16. Dec 03, 2013
  17. Dec 01, 2013
  18. Nov 27, 2013
    • Nadav Har'El's avatar
      Test: Small bugfix for tst-loadbalance · 3f494068
      Nadav Har'El authored
      
      Add missing join() in tst-loadbalance, to avoid rare crashes during the
      test.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      3f494068
    • Nadav Har'El's avatar
      Test for scheduler's single-CPU fairness. · a8c2fea7
      Nadav Har'El authored
      
      This patch adds tst-scheduler.cc, containing a few tests for the fairness
      of scheduling of several threads on one CPU (for scheduling issues involving
      load-balancing across multiple CPUs, check out the existing tst-loadbalance).
      
      The test is written in standard C++11, so it can be compiled and
      run on both Linux and OSv, to compare their scheduler behaviors.
      It is actually more a benchmark then a test (it doesn't "succeed" or "fail").
      
      The test begins with several tests of the long-term fairness of the
      schduler when threads of different or identical priorities are run for
      10 seconds, and we look at how much work each thread got done in those
      10 seconds. This test only works on OSv (which supports float priorities).
      
      The second part of the test again tests long-term fairness of the scheduler
      when all threads have the default priority (so this test is standard C++11):
      We run a loop which takes (when run alone) 10 seconds, on 2 or 3
      threads in parallel. We expect to see that all 2 or 3 threads
      finish at (more-or-less) exactly the same time - after 20 or 30
      seconds. Both OSv and Linux pass this test with flying colors.
      
      The third part of the test runs two different threads concurrently:
       1. One thread wants to use all available CPU to loop for 10 seconds.
       2. The second thread wants to loop in an amount that takes N
          milliseconds, and then sleep for N milliseconds, and so on,
          until completing the same number of loop iterations that (when run
          alone) takes 10 seconds.
      
      The "fair" behavior of the this test is that both threads get equal
      CPU time and finish together: Thread 2 runs for N milliseconds, then
      while it is sleeping for N more, Thread 1 gets to run.
      This measure this for N=1 through 32ms. In OSv's new scheduler, indeed both
      threads get an almost fair share (with N=32ms, one thread finishes in 19
      seconds, the second in 21.4 seconds; we don't expect total fairness because
      of the runtime decay).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      a8c2fea7
    • Avi Kivity's avatar
      tst-tcp: set SO_REUSEADDR · 63a99d22
      Avi Kivity authored
      
      Allows longer tests to be run.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      63a99d22
Loading