1. 02 Apr, 2017 17 commits
    • Kir Kolyshkin's avatar
      travis: enable ccache for docker/qemu builds · 7290de59
      Kir Kolyshkin authored
      As we compile-test non-x86_64 architectures under qemu emulation,
      it works pretty slow.
      Dmitry Safonov suggested, and Andrey Vagin initially implemented
      supporting ccache for such builds. This patch is based heavily
      on Andrey's work -- all the bugs added are purely mine though.
      
      Performance results: in an ideal environment (two builds of the same
      code, one with cold (empty) ccache, another with the hot one)
      I saw compile time improvements of 4x to 5x, and total test run time
      improvement up to 2x to 2.5x. In layman terms, the complete test run
      that was taking more than 50 minutes now takes about 25!
      
      Notes on handling .ccache directory:
      
      1. Before running docker build, .ccache directory (saved in between
         runs by Travis) is moved to criu source code root, from where it
         is copied by docker together with criu sources.
      
      2. In Dockerfile, .ccache gets moved to /tmp, and CCACHE_DIR
         is set accordingly.
      
      3. After running docker build, .ccache is copied out from docker
         container back to the host (from where it is saved by Travis).
      
      Ccache envorinment notes:
      
      1. CCACHE_NOCOMPRESS is needed because otherwise tons of time is spent
         on compression/decompression (big performance hit under qemu).
      
      2. CCACHE_CPP2 is required with clang, see detailed explanation at
         http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
         The logic of setting CCACHE_CPP2 in Dockerfile is somewhat fancy;
         unfortunately I was not able to come up with a simpler approach.
      
      Misc:
      
      1. Travis runs "ccache -s" after the build is completed. A call to
         "ccache -s" is called to Dockerfile before make, so one can
         compare before/after numbers.
      
      2. make invocations are surrounded by "date" calls so one can get the
         compilation times.
      
      Changes in v2:
       - consolidate Dockerfile statements (ENV, RUN)
       - single object make test is no longer commented out
       - simplify "make mrproper" test
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      7290de59
    • Kir Kolyshkin's avatar
      test/zdtm: use separate compile/link · 5204a193
      Kir Kolyshkin authored
      For compatibility with ccache (so it can cache the compilation results),
      let's compile and link separately. For this, we have to
       - disable the implicit make rules
       - write the explicit ones
      
      While at it, do use the "silent make" stuff that is already here
      
      FIXME: figure out if it helps to speed up ccache build
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      5204a193
    • Kir Kolyshkin's avatar
      travis: enable ccache for local builds · 29f9e6e2
      Kir Kolyshkin authored
      For now, it's done for local builds only (i.e. no per-arch Docker
      builds yet). The reason is, it's easier to play with ccache when
      the compiles are (relatively) fast.
      
      Performance: there is 2x to 3x improvement in build speeds for
      ideal cases (same code, hot cache), but the absolute savings
      are negligible (example: 7 seconds instead of 23).
      
      Note that ccache is not compatible with gcov, so we only enable it
      for non-gcov build (which happens to be the one with clang).
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      29f9e6e2
    • Kir Kolyshkin's avatar
      scripts/build/Makefile: fix · c903ddfc
      Kir Kolyshkin authored
      Unify alpine and non-alpine builds. The only difference is foreign
      arch builds need some preparation -- separate that to a dependency.
      
      Unfortunately we can't use wildcard targets ("%: ") as non-wildcard
      ones are prevaling. Therefore, a somewhat ugly hack to generate
      $arch: Dockerfile.$arch dependency is added.
      
      While at it:
       - rename DB_ARGS to DB_CC
       - mark clean as phony
       - make "all" really run all the builds we can
      
      Nice side effect: autocompletion ("make -C scripts/build <TAB>")
      now works!
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      c903ddfc
    • Kir Kolyshkin's avatar
      travis: fix clang builds · 6866fd2e
      Kir Kolyshkin authored
      As pointed out by Andrey, arch clang tests are using gcc regardless
      of CLANG=1 set in travis environment.
      
      Frankly, I do not understand how it worked before (while being
      pretty sure it worked!), but here is a way to fix it.
      Reported-by: 's avatarAndrey Vagin <avagin@virtuozzo.com>
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      6866fd2e
    • Kir Kolyshkin's avatar
      compel ppc64 infect.c: fix clang compilation · a6ed6964
      Kir Kolyshkin authored
      This is generated by clang-3.8:
      > compel/arch/ppc64/src/lib/infect.c:31:20: error: unused function
      > '__check_code_syscall' [-Werror,-Wunused-function]
      > static inline void __check_code_syscall(void)
      >                    ^
      
      The fix is the same as in commit 3ea2fd78.
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      a6ed6964
    • Kir Kolyshkin's avatar
      criu/arch/arm/bitops.S: fix clang compile · 81a424ae
      Kir Kolyshkin authored
      clang-3.8 complains:
      
      > criu/arch/arm/bitops.S:5:2: error: invalid instruction
      >  strneb r1, [ip] @ assert word-aligned
      >  ^
      
      Apparently (see [1]) this is some old asm syntax, which, I guess,
      was deliberately dropped from clang.
      
      [1] https://sourceware.org/ml/libc-ports/2013-03/msg00095.html
      
      Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Reviewed-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      81a424ae
    • Adrian Reber's avatar
      zdtm: print test case summary also if all test cases pass · 905c4084
      Adrian Reber authored
      If using the '--keep-going' option, zdtm prints out an overview how many
      tests were run, failed and skipped. This would also be useful to know if
      it did not fail. This patch changes the output like this:
      
       ################## ALL TEST(S) PASSED (TOTAL 297/SKIPPED 36) ###################
      
      or in the case of a failure it is unchanged:
      
       ################### 2 TEST(S) FAILED (TOTAL 297/SKIPPED 34) ####################
        * zdtm/static/sched_policy00(ns)
        * zdtm/static/cgroup02(h)
       ##################################### FAIL #####################################
      Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      905c4084
    • Adrian Reber's avatar
      zdtm: fix decode_flav() · 3edd0576
      Adrian Reber authored
      decode_flav() was doing 'if i in flavors:' where 'i' was an integer but
      the keys from the flavors dict are strings 'h', 'ns' and 'uns'.
      Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      3edd0576
    • Cyrill Gorcunov's avatar
      compel: infect -- Don't forget to fetch sas early · 6e4d0585
      Cyrill Gorcunov authored
      When infecting victim we construct sigframe to
      be able to self-rectore it in case if something
      goes wrong. But in case is a targer been using
      alternative stack for signal handling it will
      be missed in sigframe since we don't fetch it.
      
      Thus add fetching sas on infection stage and
      put it into signal frame early.
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      6e4d0585
    • Dmitry Safonov's avatar
      x86/32: don't unmap vdso_rt after redirecting calls there · e5de8986
      Dmitry Safonov authored
      We need to leave this part of restorer in restored task in case
      of inserted redirected calls. Jump trampolines from old vdso lead
      here - it would be painful to land nowhere.
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      e5de8986
    • Dmitry Safonov's avatar
      x86/32: rectify compatible jump trampolines · 684dbef1
      Dmitry Safonov authored
      Reworked this code a little and it becomes more readable.
      Drop those macroses under CONFIG_X86_64 define and just use
      boolean `compat_vdso' to check whether insert 64 or 32-bit jmp.
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      684dbef1
    • Dmitry Safonov's avatar
      vdso: remove per-arch declaration for vdso_redirect_calls · e56c642e
      Dmitry Safonov authored
      It's the same on all archs (as it's called from generic code),
      no need to redeclare it. <parasite-vdso.h> is included in all
      per-arch headers. Drop vdso_symtable forward declaration as
      <parasite-vdso.h> includes <util-vdso.h> header which defines
      the structure.
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      e56c642e
    • Cyrill Gorcunov's avatar
      mem: Use long for memory size · 4d1cacec
      Cyrill Gorcunov authored
      When checkpointing applications with really big
      memory slab (like in our vz7 test with 920G of
      memory) the int type get cutted, we should use
      long int instead, just like we do in other code
      pieces.
      
      Otherwise get (on vz7's criu, which s sharing the code)
      
       | pie: 756: Daemon waits for command
       | (01.193097) Wait for ack 12 on daemon socket
       | (01.193112) Fetched ack: 12 12 0
       | (01.193164) 988065 fdinfo 0: pos:                0 flags:           100002/0
       | (01.193201) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 0
       | (01.193279) 988065 fdinfo 1: pos:                0 flags:           100002/0
       | (01.193307) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 1
       | (01.193341) 988065 fdinfo 2: pos:                0 flags:           100002/0
       | (01.193365) fdinfo: type: 0xb flags: 0100002/0 pos:        0 fd: 2
       | (01.193375) ----------------------------------------
       | (01.193405) Error (criu/parasite-syscall.c:243): BUG at criu/parasite-syscall.c:243
       | pie: 756: Error (criu/pie/parasite.c:676): Trimmed message received (1>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      4d1cacec
    • Cyrill Gorcunov's avatar
      e4d1ae34
    • Cyrill Gorcunov's avatar
      sk-inet: Add support for shutdown'ed UDP/UDPlite sockets · a155afda
      Cyrill Gorcunov authored
      Supporting shutdown for dgram sockets (udp and udplite)
      is simple -- just fetch the state from diag module and
      record it in the image, then upon socket creation restore
      this state.
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      a155afda
    • Pavel Tikhomirov's avatar
      fsnotify: skip non-direcory mounts · 4f3927a6
      Pavel Tikhomirov authored
      To restore fsnotify's watches on files we need to find paths for each
      of them using handle we have in /proc/<pid>/fdinfo/<fsnotifyfd>.
      These handle is valid to open the file with open_by_handle_at if
      you have mount fd where the file lays. So we try open_by_handle_at
      for all possible mount fds we have.
      
      But we can not do so for 'file' bind-mounts, as the way we open
      mount fd opens file instead and can hang on fifos or fail on sockets.
      (see check_open_handle->open_handle->open_mount code path, imagine
      lookup_mnt_sdev() found 'file' bind-mount, open_mount() failed(hanged)
      in __open_mountpoint() and if irmap_lookup() also was not successful the
      whole dump fails too)
      
      So if we have file bindmount of fifo file, and we restore some
      inotify on other file on other mount with same s_dev, we hang forever
      on open.
      
      So just skip non-directory mounts from inotify search we will find
      path for them on other mount(e.g. non-bindmount) with same s_dev.
      
      v2: remove isdir hashing, improve commit message
      v3: make lookup_mnt_sdev handle only nondir mounts, add comment,
      move more expensive notdir_mountpoint check after s_dev
      v4: inverse notdir_mountpoint to be mnt_is_dir, now on error
      in mnt_is_dir mount is also skipped
      Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
      Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      4f3927a6
  2. 27 Mar, 2017 2 commits
  3. 15 Mar, 2017 21 commits