epoll: Add support for duped targets

Submitted by Andrey Vagin on June 20, 2018, 12:01 p.m.

Details

Reviewer None
Submitted June 20, 2018, 12:01 p.m.
Last Updated July 5, 2018, 2:58 a.m.
Revision 7

Cover Letter

We need to support a case where file has been added into
epoll, then duped into some other number, and finally
the former one is closed. So that epoll fdinfo will
print no longer existing fd number (in this series
we will find which new file is matching the target).

v2:
 - add support for multiple dup'ed targets
 - address the test for new features

v4:
 - fix target files descriptors retrieval
 - new test by @avagin

v5:
 - use files rbtree to speedup target files lookup

https://travis-ci.org/cyrillos/criu/builds/400066560

Andrei Vagin (1):
  zdtm/static: add a test to check epoll file descriptors

Cyrill Gorcunov (18):
  kcmp: Cleanup sources
  kcmp: Beautify kcmp-ids.h
  kcmp: Drop empty line at EOF
  kcmp: Add epoll definitions
  epoll: kdat -- Check if we have KCMP_EPOLL_TFD support
  epoll: Pass drained fds to dump_one_file
  epoll: Use real file transferred for target fds check
  epoll: Use kcmp to find proper target file
  epoll: Add support for multiple duped fds
  epoll: Show tfd in decimal form
  epoll: Print efd id when showing targets
  epoll: Align members in assignments
  epoll: Add kcmp_epoll check
  epoll: Save fields of target files in eventpoll_tfd_entry
  epoll: Exit with error if tfd is missing
  epoll: Add kid_lookup_epoll_tfd helper
  files: make_gen_id -- Promote to be general helper
  epoll: Use epoll queues to speedup multiple duped fds

 criu/cr-check.c             |  10 ++
 criu/cr-dump.c              |   6 +
 criu/eventpoll.c            | 330 +++++++++++++++++++++++++++++++++++++++-----
 criu/file-ids.c             |   2 +-
 criu/files.c                |  19 ++-
 criu/include/eventpoll.h    |   2 +
 criu/include/file-ids.h     |   2 +
 criu/include/files.h        |   3 +
 criu/include/kcmp-ids.h     |  33 +++--
 criu/include/kcmp.h         |  10 ++
 criu/include/kerndat.h      |   1 +
 criu/kcmp-ids.c             |  64 ++++++++-
 criu/kerndat.c              |  48 +++++++
 criu/proc_parse.c           |  20 ++-
 images/eventpoll.proto      |   5 +
 test/zdtm/static/Makefile   |   1 +
 test/zdtm/static/epoll.c    | 137 ++++++++++++++++++
 test/zdtm/static/epoll.desc |   1 +
 18 files changed, 635 insertions(+), 59 deletions(-)
 create mode 100644 test/zdtm/static/epoll.c
 create mode 100644 test/zdtm/static/epoll.desc
  

Revisions

SERIES REVISION LOOKS STRANGE. Please double-check patch list and the ordering before proceeding.

Patches download mbox

Tests