[CRIU] [PATCH 0/6] collect all pid-s in rbtree (v3)

Andrey Vagin avagin at openvz.org
Mon Mar 14 23:37:11 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Currently our pid allocator is too simple, it returns max_pid++
and it may return a value which is bigger than kernel.pid_map.

With this patches we have a sorted array of pid-s and we can find
free pid-s very fast.

In addition, we can find a pstree_item by pid faster (O(log n) instead of O(n)).

https://jira.sw.ru/browse/PSBM-42202

v2: fix comments from Pavel.
v3: rename insert_pid into lookup_create_pid

Andrew Vagin (6):
  pstree: move state from pstree_item to pid
  pstree: split alloc_pstree_helper
  pstree: prepare to store all pid-s in rb-tree (v3)
  pstree: resort code about abandoned tasks
  pstree: use rbtree to find a specified pid (v2)
  pstree: try to find a free pid between busy pids (v2)

 criu/cr-dump.c        |  16 ++--
 criu/cr-restore.c     |  22 ++---
 criu/files-reg.c      |  17 ++--
 criu/image.c          |   2 +-
 criu/include/image.h  |   2 +
 criu/include/pid.h    |   5 +
 criu/include/pstree.h |   9 +-
 criu/pstree.c         | 247 +++++++++++++++++++++++++++++++++++---------------
 criu/seccomp.c        |   2 +-
 criu/seize.c          |  16 ++--
 10 files changed, 224 insertions(+), 114 deletions(-)

--
2.5.0



More information about the CRIU mailing list