Skip to content
Snippets Groups Projects
  1. May 19, 2014
    • Glauber Costa's avatar
      rework OSV_SYM macro · 34ddac25
      Glauber Costa authored
      
      As Nadav pointed out during review, this macro could use a bit more work, to
      use a single parameter instead of one. That is what is done in this patch.
      Unfortunately just pasting __COUNTER__ doesn't work because of preprocessor
      rules, and we need some indirection to get it working. Also, visibility
      "hidden" can go because that is already implied by "static". The problem then
      becomes the fact that gcc does not really like unreferenced static variables,
      which is solved by the "used" attribute. From gcc docs about "used":
      
         "This attribute, attached to a variable with the static storage, means that
          the variable must be emitted even if it appears that the variable is not
          referenced."
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      34ddac25
  2. May 18, 2014
  3. May 16, 2014
  4. May 15, 2014
    • Pawel Dziepak's avatar
      sched: reimplement incoming_wakeup_queue · bca7bbbe
      Pawel Dziepak authored
      
      This patch implements lockfree_queue (which is used as incoming_wakeup_queue)
      so that it doesn't need exchange or compare_exchange operations.
      
      The idea is to use a linked list but interleave actual objects stored in the
      queue with helper object (lockless_queue_helper) which are just pointer to the
      next element. Each object in the queue owns the helper that precedes it (and
      they are dequeued together) while the last helper, which does not precede any
      object is owned by the queue itself.
      
      When a new object is enqueued it gains ownership of the last helper in the
      queue in exchange of the helper it owned before which now becomes the new
      tail of the list.
      
      Unlike the original implementation this version of lockfree_queue really
      requires that there is no more than one concurrent producer and no more than
      one concurrent consumer.
      
      The results oftests/misc-ctxs on my test machine are as follows (the values
      are medians of five runs):
      
      before:
      colocated: 332 ns
      apart: 590 ns
      
      after:
      colocated: 313 ns
      apart: 558 ns
      
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPawel Dziepak <pdziepak@quarnos.org>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      bca7bbbe
  5. May 14, 2014
  6. May 12, 2014
  7. May 07, 2014
  8. May 06, 2014
  9. May 05, 2014
    • Tomasz Grabiec's avatar
      trace: cleanup packet tracing · 593f26d6
      Tomasz Grabiec authored
      
      The current tracepoint coverage does not handle all situations
      well. In particular:
      
       * it does not cover link layer devices other than virtio-net. This
         change fixes that by tracing in more abstract layers.
      
       * it records incoming packets at enqueue time, whereas sometimes it's
         better to trace at handling time. This can be very useful when
         correlating TCP state changes with incoming packets. New tracepoint
         was introduced for that: net_packet_handling.
      
       * it does not record protocol of the buffer. For non-ethernet
         protocols we should set appropriate protocol type when
         reconstructing ethernet frame when dumping to PCAP.
      
      We now have the following tracepoints:
      
       * net_packet_in - for incoming packets, enqueued or handled directly.
      
       * net_packet_out - for outgoing packets hitting link layer (not
         loopback).
      
       * net_packet_handling - for packets which have been queued and are
         now being handled.
      
      Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      593f26d6
  10. May 03, 2014
  11. May 01, 2014
  12. Apr 29, 2014
  13. Apr 28, 2014
    • Nadav Har'El's avatar
      malloc: Fix small allocations with alignment > size. · c8845bb5
      Nadav Har'El authored
      
      When a small allocation is requested with large alignment, we ignored
      the alignment, and as a consequence posix_memalign() or
      alloc_phys_contiguous_aligned() could crash when it failed to achieve
      the desired alignment. This is not a common case (usually, size >= alignment,
      and the new C11 aligned_alloc() even supports only this case), but still
      it might happen, and we saw it in cloudius-systems/capstan#75.
      
      When size < alignment, this patch changes the size so we can achieve the
      desired alignment. For small alignments, this means setting size=alignment,
      so for example to get an alignment of 1024 bytes we need at least 1024-byte
      allocation. This is a waste of memory, but as these allocations are rare,
      we expect this to be acceptable. For large alignments, e.g., alignment=8192,
      we don't need size=alignment but we do need size to be large enough so we'll
      use malloc_large() (malloc_large() already supports arbitrarily large
      alignments).
      
      This patch also adds test cases to tst-align.so to test alignments larger
      than the desired size.
      
      Fixes #271 and cloudius-systems/capstan#75.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      c8845bb5
  14. Apr 25, 2014
Loading