Open
Conversation
Author
|
@avagin I am reading ipc/mqueue.c in the kernel source. mq_timedreceive lacks a flags argument, we can't simply add a |
Member
If I understand correctly, the following GSoC project idea aims to introduce this kernel interface: |
Author
|
@rst0git Yes , we need kernal interface, the pr is just to ckeck the old kernals support the posix feature and pave the way for this interface, I am currently working on the kernel side |
Dumping a process that holds open mqueue descriptors fails with "Can't lookup mount" because CRIU has no handler for the mqueue fd type. There is no runtime check to surface this gap early, so users get a cryptic dump failure with no actionable output. Add check_posix_mqueue() that probes /proc/sys/fs/mqueue, which only exists when CONFIG_POSIX_MQUEUE=y. The check is placed in the Category 2 block alongside check_posix_timers() and wired into feature_list[] so it can be queried directly: criu check --feature posix_mqueue Signed-off-by: Abdullah Albadawy <abdullahalbadawy1@gmail.com>
MQUEUE_MAGIC (0x19800202) is missing from fs-magic.h while every other filesystem CRIU handles is listed there. The value is defined in ipc/mqueue.c in the kernel source and is needed to identify mqueue file descriptors via fstatfs() when implementing POSIX mqueue full feature Signed-off-by: Abdullah Albadawy <abdullahalbadawy1@gmail.com>
POSIX message queues are implemented as the mqueue virtual filesystem. Dumping a process that holds open mqueue descriptors currently fails with "Can't lookup mount" because CRIU has no handler for the mqueue fd type and no way to save queue contents. Add support using the intrusive approach: during dump, messages are drained from each queue with mq_receive(), serialised to the image, then put back with mq_send() before the process is resumed. The process is frozen by ptrace for the entire operation so no new messages can arrive in the window between drain and refill. Changes: - images/mqueue.proto: protobuf schema for queue attributes (pmq_data_entry), per-message data (mqueue_message), and open file descriptor state (pmqfd_entry) - criu/mqueue.c + criu/include/mqueue.h: core implementation with intrusive_mq_peek_all(), restore_pmq_messages(), dump_pmq_fd(), open_pmq_fd(), and pmqfd_cinfo - criu/ipc_ns.c: dump_ipc_pmq() enumerates /dev/mqueue and calls intrusive_mq_peek_all(); prepare_ipc_pmq() recreates queues with saved attributes and restores messages - criu/files.c: route fds on MQUEUE_MAGIC filesystem to dump_pmq_fd() - criu/cr-restore.c: register pmqfd_cinfo for fd collection - criu/image-desc.c + image-desc.h: IPCNS_PMQ, PMQ_DATA, PMQFD image types - criu/include/protobuf-desc.h + protobuf-desc.c: register PB_PMQFD, PB_IPCNS_PMQ_DATA, PB_MQUEUE_MESSAGE descriptors - images/fdinfo.proto: add PMQFD fd type and pmqfd_entry - test/zdtm/static/posix_mqueue.c: ZDTM test that creates a queue, sends two messages with different priorities, checkpoints, restores, and verifies both messages are intact in priority order Link: checkpoint-restore#2285 Assisted-by: Claude:sonnet-4.6 Signed-off-by: Abdullah Albadawy <abdullahalbadawy1@gmail.com>
27d1039 to
2914b0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add foundation for POSIX message queues [[#2285]]
What and How
check_posix_mqueue()[[criu: cr-check: add POSIX mqueue kernel support check #2957]] tocriu/cr-check.cto verify kernel support by checking the/proc/sys/fs/mqueueinterface.MQUEUE_MAGIC[#2958] and registered it in thefstypesarray incriu/filesystems.c. This enables CRIU to recognize and validatemqueuemounts using standardstatfs()calls.These are foundational for the upcoming POSIX mqueue feature. Before implementing message retrieval logic, it is essential that CRIU can properly identify the
mqueuevirtual filesystem and verify kernel support.Signed-off-by: Abdullah Albadawy abdullahalbadawy1@gmail.com