1. 02 Oct, 2014 3 commits
  2. 01 Oct, 2014 11 commits
  3. 30 Sep, 2014 21 commits
  4. 29 Sep, 2014 5 commits
    • Pavel Emelyanov's avatar
      bfd: Multiple buffers management (v2) · 5eb39aad
      Pavel Emelyanov authored
      I plan to re-use the bfd engine for images buffering. Right
      now this engine uses one buffer that gets reused by all
      bfdopen()-s. This works for current usage (one-by-pne proc
      files access), but for images we'll need more buffers.
      
      So this patch just puts buffers in a list and organizes a
      stupid R-R with refill on it.
      
      v2:
        Check for buffer allocation errors
        Print buffer mem pointer in debug
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
      5eb39aad
    • Pavel Emelyanov's avatar
      dump: Don't close pid-proc in vain · 1a2e6cbd
      Pavel Emelyanov authored
      The open_pid_proc engine knows itself how to cache
      per-pid descriptors. No need in closing it by hands.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      1a2e6cbd
    • Pavel Emelyanov's avatar
      proc: Keep /proc/self cached separately from /proc/pid · abeae267
      Pavel Emelyanov authored
      When dumping tasks we do a lot of open_proc()-s and to
      speed this up the /proc/pid directory is opened first
      and the fd is kept cached. So next open_proc()-s do just
      openat(cached_fd, name).
      
      The thing is that we sometimes call open_proc(PROC_SELF)
      in between and proc helpers cache the /proc/self too. As
      the result we have a bunch of
      
        open(/proc/pid)
        close()
        open(/proc/self)
        close()
      
      see-saw-s in the middle of dumping tasks.
      
      To fix this we may cache the /proc/self separately from
      the /proc/pid descriptor. This eliminates quite a lot
      of pointless open-s and close-s.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      abeae267
    • Pavel Emelyanov's avatar
      fd: Close caches proc-pid stuff before restoring files · 829d4332
      Pavel Emelyanov authored
      We have a bug. If someone opens proc with open_pid_proc or alike
      with PROC_SELF of real PID before going to restore fds, then the
      fd cached by proc helpers would be cached in fd 0 (we close all
      fds beforehead) and it may clash with restored fds.
      
      We don't hit this right now simply due to being too lucky -- we
      call open_proc(PROC_GEN) on "locks" which first closes the cached
      the per-pid descriptor and then reports back just the /proc one
      which sits in service area.
      
      But once we change this (next patch) things would get broken.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      829d4332
    • Pavel Emelyanov's avatar
      proc: Sanitate empty lines · 1c8ab40e
      Pavel Emelyanov authored
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      1c8ab40e