|[PATCH v4 0/9] IPC: checkpoint/restore in userspace enhancements [message #47488]
||Mon, 13 August 2012 12:31
Registered: October 2011
1) If MSG_COPY flag is specified, then "mtype" is not a type, but message
number to copy.
2) MSG_SET_COPY logic for sys_msgctl() was removed.
1) Copy messages to user-space under spinlock was replaced by allocation of
dummy message before queue lock and then copy of desired message to the dummy
one instead of unlinking it from queue list.
I.e. the message queue copy logic was changed: messages can be retrived one by
one (instead of receiving of the whole list at once).
This patch set is aimed to provide additional functionality for all IPC objects,
which is required for migration of these objects by user-space
checkpoint/restore utils (CRIU).
The main problem here was impossibility to set up object id. This patch set
solves the problem in two steps:
1) Makes it possible to create new object (shared memory, semaphores set or
messages queue) with ID, equal to passed key.
2) Makes it possible to change existent object key.
Another problem was to peek messages from queues without deleting them.
This was achived by introducing of new MSG_COPY flag for sys_msgrcv() and
MSG_SET_COPY command for sys_msgctl() (which can be used to select message
number to copy).
The following series implements...
Stanislav Kinsbursky (9):
ipc: remove forced assignment of selected message
ipc: "use key as id" functionality for resource get system call introduced
ipc: segment key change helper introduced
ipc: add new SHM_SET command for sys_shmctl() call
ipc: add new MSG_SET command for sys_msgctl() call
ipc: add new SEM_SET command for sys_semctl() call
IPC: message queue receive cleanup
IPC: message queue copy feature introduced
test: IPC message queue migration test
arch/tile/kernel/compat.c | 29 +++++++
include/linux/compat.h | 2
include/linux/ipc.h | 1
include/linux/msg.h | 7 +-
include/linux/sem.h | 1
include/linux/shm.h | 1
ipc/compat.c | 42 ++++++---
ipc/msg.c | 110 +++++++++++++++++++------
ipc/msgutil.c | 38 +++++++++
ipc/sem.c | 11 ++
ipc/shm.c | 14 +++
ipc/util.c | 59 ++++++++++++-
ipc/util.h | 4 +
security/selinux/hooks.c | 3 +
security/smack/smack_lsm.c | 3 +
tools/testing/selftests/ipc/msgque.c | 151 ++++++++++++++++++++++++++++++++++
16 files changed, 424 insertions(+), 52 deletions(-)
create mode 100644 tools/testing/selftests/ipc/msgque.c