[CRIU] [PATCH 0/5] collect all pid-s in rbtree

Andrey Vagin avagin at openvz.org
Fri Feb 19 10:13:26 PST 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

Andrew Vagin (5):
  pstree: move state from pstree_item to pid
  pstree: split alloc_pstree_helper
  pstree: prepare to store all pid-s in rb-tree
  pstree: try to find a free pid between busy pids
  pstree: use rbtree to find a specified pid

 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 |   7 +-
 criu/pstree.c         | 203 +++++++++++++++++++++++++++++++++++---------------
 criu/seccomp.c        |   2 +-
 criu/seize.c          |  16 ++--
 10 files changed, 193 insertions(+), 99 deletions(-)

-- 
2.5.0



More information about the CRIU mailing list