Skip to contentSkip to conversation

Add new system call for non-destructive peek and inspection to posix ipc mqueue

PATCH Superseded Mathura_Kumar 2 participants 8 messages Mar 15 – Mar 18 2 messages not in the archive

Subsystems (20)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add new system call for non-destructive peek and inspection to posix ipc mqueue

Patch series overview:

1. Add New system call do_mq_timedreceive2() and handler implementation
2. Add system call number in all most common arch.
3. Prepared Documentation and test
4. Add entry in performance tools all most common file

Short Description:

POSIX message queues currently lack a mechanism to read a message without removing it from the queue. This is a long-standing limitation,when we require inspection of queue state without altering it.

Design considerations:
Two approaches for copying message data to userspace were evaluated:

1) Refcount-based message lifecycle handling
- This can help us Avoids intermediate temp kernel copy
- Extends message lifetime
-But this may increase writer starvation under heavy load and
add unnecessary complication on priority management and delay more time to free space in inode due refcount may prevent

2) Temporary kernel buffer copy
- Copies message into a bounded kernel buffer
- Reduces time message remains locked
- Improves fairness under write-heavy workloads
- Simpler lifetime management

My implementation adopts the temporary buffer approach to minimize starvation and reduce locking complexity. The design allows future transition if refcounting is deemed preferable.

Testing:
- 17 functional test cases
- Multi-threaded producer/consumer scenarios
- concurrent pop and peek
- Edge cases: empty queue, FIFO invalid flags, signal interruption etc.

Use Case:

1) Observability in distributed systems
e.g Monitoring tools can inspect queue contents without interfering with
normal processing

2) Check pointing system like CRIU can have a look into queue without consuming and can store messages

3) Resource-aware processing

4) Selective Consumption for Specialized Workers

change since v1:
- minor update, header guard was removed from include/uapi/linux/mqueue.h
- v1 Link: https://lore.kernel.org/all/[email protected]/T/#t

Thanks for reviewing.

 Documentation/userspace-api/index.rst         |   1 +
 Documentation/userspace-api/ipc.rst           | 222 +++++
 arch/alpha/kernel/syscalls/syscall.tbl        |   1 +
 arch/arm/tools/syscall.tbl                    |   1 +
 arch/arm64/tools/syscall_32.tbl               |   1 +
 arch/m68k/kernel/syscalls/syscall.tbl         |   1 +
 arch/microblaze/kernel/syscalls/syscall.tbl   |   1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl     |   1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl     |   1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl     |   1 +
 arch/parisc/kernel/syscalls/syscall.tbl       |   1 +
 arch/powerpc/kernel/syscalls/syscall.tbl      |   1 +
 arch/s390/kernel/syscalls/syscall.tbl         |   1 +
 arch/sh/kernel/syscalls/syscall.tbl           |   1 +
 arch/sparc/kernel/syscalls/syscall.tbl        |   1 +
 arch/x86/entry/syscalls/syscall_32.tbl        |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl        |   1 +
 arch/xtensa/kernel/syscalls/syscall.tbl       |   1 +
 include/linux/compat.h                        |   6 +-
 include/linux/syscalls.h                      |   6 +
 include/uapi/asm-generic/unistd.h             |   7 +-
 include/uapi/linux/mqueue.h                   |  14 +-
 ipc/mqueue.c                                  | 186 ++++-
 ipc/msg.c                                     |   2 +-
 ipc/msgutil.c                                 |  48 +-
 ipc/util.h                                    |   3 +-
 kernel/sys_ni.c                               |   1 +
 scripts/syscall.tbl                           |   1 +
 .../arch/alpha/entry/syscalls/syscall.tbl     |   1 +
 .../perf/arch/arm/entry/syscalls/syscall.tbl  |   1 +
 .../arch/arm64/entry/syscalls/syscall_32.tbl  |   1 +
 .../arch/mips/entry/syscalls/syscall_n64.tbl  |   1 +
 .../arch/parisc/entry/syscalls/syscall.tbl    |   1 +
 .../arch/powerpc/entry/syscalls/syscall.tbl   |   1 +
 .../perf/arch/s390/entry/syscalls/syscall.tbl |   1 +
 tools/perf/arch/sh/entry/syscalls/syscall.tbl |   1 +
 .../arch/sparc/entry/syscalls/syscall.tbl     |   1 +
 .../arch/x86/entry/syscalls/syscall_32.tbl    |   1 +
 .../arch/x86/entry/syscalls/syscall_64.tbl    |   1 +
 .../arch/xtensa/entry/syscalls/syscall.tbl    |   1 +
 tools/scripts/syscall.tbl                     |   1 +
 tools/testing/selftests/ipc/.gitignore        |   1 +
 tools/testing/selftests/ipc/Makefile          |   9 +-
 tools/testing/selftests/ipc/mq_peek.c         | 785 ++++++++++++++++++
 44 files changed, 1278 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/userspace-api/ipc.rst
 create mode 100644 tools/testing/selftests/ipc/mq_peek.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/4 IPC: Added New system call do_mq_timedreceive2() for non-destructive peek on posix mqueue

---
 include/linux/compat.h            |   6 +-
 include/linux/syscalls.h          |   6 +
 include/uapi/asm-generic/unistd.h |   7 +-
 include/uapi/linux/mqueue.h       |  14 ++-
 ipc/mqueue.c                      | 186 ++++++++++++++++++++++++++++--
 ipc/msg.c                         |   2 +-
 ipc/msgutil.c                     |  48 ++++----
 ipc/util.h                        |   3 +-
 kernel/sys_ni.c                   |   1 +
 9 files changed, 231 insertions(+), 42 deletions(-)
include/linux/compat.h +4 -2
index 56cebaff0c91..9f5ca26e76d8 100644
@@ -22,6 +22,7 @@
 #include <asm/compat.h>
 #include <asm/siginfo.h>
 #include <asm/signal.h>
+#include <linux/mqueue.h>
 
 #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
 /*
@@ -801,8 +802,9 @@ asmlinkage long compat_sys_pwritev64v2(unsigned long fd,
 		const struct iovec __user *vec,
 		unsigned long vlen, loff_t pos, rwf_t flags);
 #endif
-
-
+asmlinkage long compat_sys_mq_timedreceive2(mqd_t mqdes, struct compat_mq_timedreceive2_args __user *uargs,
+											unsigned int flags, unsigned long index,
+											struct old_timespec32 __user *abs_timeout);
 /*
  * Deprecated system calls which are still defined in
  * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
include/linux/syscalls.h +6 -0
index 02bd6ddb6278..993e570c90ab 100644
@@ -79,6 +79,7 @@ struct mnt_id_req;
 struct ns_id_req;
 struct xattr_args;
 struct file_attr;
+struct mq_timedreceive2_args;
 
 #include <linux/types.h>
 #include <linux/aio_abi.h>
@@ -93,6 +94,7 @@ struct file_attr;
 #include <linux/key.h>
 #include <linux/personality.h>
 #include <trace/syscall.h>
+#include <linux/mqueue.h>
 
 #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
 /*
@@ -746,6 +748,10 @@ asmlinkage long sys_mq_timedsend_time32(mqd_t mqdes,
 			const char __user *u_msg_ptr,
 			unsigned int msg_len, unsigned int msg_prio,
 			const struct old_timespec32 __user *u_abs_timeout);
+asmlinkage long
+sys_mq_timedreceive2(mqd_t mqdes, struct mq_timedreceive2_args __user *uargs,
+		     unsigned int flags, unsigned long index,
+		     struct __kernel_timespec __user *abs_timeout);
 asmlinkage long sys_msgget(key_t key, int msgflg);
 asmlinkage long sys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
 asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
include/uapi/asm-generic/unistd.h +5 -2
index a627acc8fb5f..200ee7fde5c4 100644
@@ -863,9 +863,12 @@ __SYSCALL(__NR_listns, sys_listns)
 #define __NR_rseq_slice_yield 471
 __SYSCALL(__NR_rseq_slice_yield, sys_rseq_slice_yield)
 
-#undef __NR_syscalls
-#define __NR_syscalls 472
+#define __NR_mq_timedreceive2 472
+__SC_COMP(__NR_mq_timedreceive2, sys_mq_timedreceive2,
+		compat_sys_mq_timedreceive2)
 
+#undef __NR_syscalls
+#define __NR_syscalls 473
 /*
  * 32 bit systems traditionally used different
  * syscalls for off_t and loff_t arguments, while
include/uapi/linux/mqueue.h +13 -1
index b516b66840ad..7cdced63f5d2 100644
@@ -18,8 +18,8 @@
 
 #ifndef _LINUX_MQUEUE_H
 #define _LINUX_MQUEUE_H
-
 #include <linux/types.h>
+#include <asm/compat.h>
 
 #define MQ_PRIO_MAX 	32768
 /* per-uid limit of kernel memory used by mqueue, in bytes */
@@ -33,6 +33,18 @@ struct mq_attr {
 	__kernel_long_t	__reserved[4];	/* ignored for input, zeroed for output */
 };
 
+struct mq_timedreceive2_args {
+	size_t msg_len;
+	unsigned int  *msg_prio;
+	char  *msg_ptr;
+};
+
+struct compat_mq_timedreceive2_args {
+	compat_size_t msg_len;
+	compat_uptr_t msg_prio;
+	compat_uptr_t msg_ptr;
+};
+
 /*
  * SIGEV_THREAD implementation:
  * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed
ipc/mqueue.c +178 -8

233 lines not on this page · raw message

ipc/msg.c +1 -1
index 62996b97f0ac..6392b11dd7f7 100644
@@ -1156,7 +1156,7 @@ static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, in
 			 * not update queue parameters.
 			 */
 			if (msgflg & MSG_COPY) {
-				msg = copy_msg(msg, copy);
+				msg = copy_msg(msg, copy, msg->m_ts);
 				goto out_unlock0;
 			}
 
ipc/msgutil.c +21 -27

67 lines not on this page · raw message

ipc/util.h +2 -1
index a55d6cebe6d3..374abeee79b3 100644
@@ -197,8 +197,9 @@ int ipc_parse_version(int *cmd);
 
 extern void free_msg(struct msg_msg *msg);
 extern struct msg_msg *load_msg(const void __user *src, size_t len);
-extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst);
+extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst, size_t len);
 extern int store_msg(void __user *dest, struct msg_msg *msg, size_t len);
+extern struct msg_msg *alloc_msg(size_t len);
 
 static inline int ipc_checkid(struct kern_ipc_perm *ipcp, int id)
 {
kernel/sys_ni.c +1 -0
index add3032da16f..658d6b8274b3 100644
@@ -391,6 +391,7 @@ COND_SYSCALL(setuid16);
 /* restartable sequence */
 COND_SYSCALL(rseq);
 COND_SYSCALL(rseq_slice_yield);
+COND_SYSCALL(mq_timedreceive2);
 
 COND_SYSCALL(uretprobe);
 COND_SYSCALL(uprobe);
Signature · 1 line
2.43.0
#2 lore raw

PATCH v2 2/4 IPC: Added system call number in all most common arch.

In reply to Mathura_Kumar
---
 arch/alpha/kernel/syscalls/syscall.tbl      | 1 +
 arch/arm/tools/syscall.tbl                  | 1 +
 arch/arm64/tools/syscall_32.tbl             | 1 +
 arch/m68k/kernel/syscalls/syscall.tbl       | 1 +
 arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl   | 1 +
 arch/parisc/kernel/syscalls/syscall.tbl     | 1 +
 arch/powerpc/kernel/syscalls/syscall.tbl    | 1 +
 arch/s390/kernel/syscalls/syscall.tbl       | 1 +
 arch/sh/kernel/syscalls/syscall.tbl         | 1 +
 arch/sparc/kernel/syscalls/syscall.tbl      | 1 +
 arch/x86/entry/syscalls/syscall_32.tbl      | 1 +
 arch/x86/entry/syscalls/syscall_64.tbl      | 1 +
 arch/xtensa/kernel/syscalls/syscall.tbl     | 1 +
 scripts/syscall.tbl                         | 1 +
 17 files changed, 17 insertions(+)
arch/alpha/kernel/syscalls/syscall.tbl +1 -0
index f31b7afffc34..0ff42d241419 100644
@@ -511,3 +511,4 @@
 579	common	file_setattr			sys_file_setattr
 580	common	listns				sys_listns
 581	common	rseq_slice_yield		sys_rseq_slice_yield
+582	common	mq_timedreceive2		sys_mq_timedreceive2
arch/arm/tools/syscall.tbl +1 -0
index 94351e22bfcf..c00a185fbe50 100644
@@ -486,3 +486,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2          compat_sys_mq_timedreceive2
arch/arm64/tools/syscall_32.tbl +1 -0
index 62d93d88e0fe..4eac85c25658 100644
@@ -483,3 +483,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2     	sys_mq_timedreceive2		compat_sys_mq_timedreceive2
arch/m68k/kernel/syscalls/syscall.tbl +1 -0
index 248934257101..6e336289eaf4 100644
@@ -471,3 +471,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2
arch/microblaze/kernel/syscalls/syscall.tbl +1 -0
index 223d26303627..6b617de0442e 100644
@@ -477,3 +477,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2
arch/mips/kernel/syscalls/syscall_n32.tbl +1 -0
index 7430714e2b8f..1f761cf9cfb0 100644
@@ -410,3 +410,4 @@
 469	n32	file_setattr			sys_file_setattr
 470	n32	listns				sys_listns
 471	n32	rseq_slice_yield		sys_rseq_slice_yield
+472	n32	mq_timedreceive2		compat_sys_mq_timedreceive2
arch/mips/kernel/syscalls/syscall_n64.tbl +1 -0
index 630aab9e5425..75de6ee2df94 100644
@@ -386,3 +386,4 @@
 469	n64	file_setattr			sys_file_setattr
 470	n64	listns				sys_listns
 471	n64	rseq_slice_yield		sys_rseq_slice_yield
+472	n64	mq_timedreceive2		sys_mq_timedreceive2
arch/mips/kernel/syscalls/syscall_o32.tbl +1 -0
index 128653112284..f11be7e34d93 100644
@@ -459,3 +459,4 @@
 469	o32	file_setattr			sys_file_setattr
 470	o32	listns				sys_listns
 471	o32	rseq_slice_yield		sys_rseq_slice_yield
+472	o32	mq_timedreceive2		sys_mq_timedreceive2	compat_sys_mq_timedreceive2
arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index f6e2d0379d57..1b22b8d0edcc 100644
@@ -470,3 +470,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
arch/powerpc/kernel/syscalls/syscall.tbl +1 -0
index 4fcc7c58a105..ab57aa18b24a 100644
@@ -562,3 +562,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	nospu	rseq_slice_yield		sys_rseq_slice_yield
+472 common	mq_timedreceive2	sys_mq_timedreceive2	compat_sys_mq_timedreceive2
\ No newline at end of file
arch/s390/kernel/syscalls/syscall.tbl +1 -0
index 09a7ef04d979..34df682061d9 100644
@@ -398,3 +398,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2
arch/sh/kernel/syscalls/syscall.tbl +1 -0
index 70b315cbe710..cac787dbef1a 100644
@@ -475,3 +475,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2
arch/sparc/kernel/syscalls/syscall.tbl +1 -0
index 7e71bf7fcd14..06bcea3622cb 100644
@@ -517,3 +517,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472 common	mq_timedreceive2	sys_mq_timedreceive2	compat_sys_mq_timedreceive2
\ No newline at end of file
arch/x86/entry/syscalls/syscall_32.tbl +1 -0
index f832ebd2d79b..79154690058f 100644
@@ -477,3 +477,4 @@
 469	i386	file_setattr		sys_file_setattr
 470	i386	listns			sys_listns
 471	i386	rseq_slice_yield	sys_rseq_slice_yield
+472	i386	mq_timedreceive2	sys_mq_timedreceive2		compat_sys_mq_timedreceive2
arch/x86/entry/syscalls/syscall_64.tbl +1 -0
index 524155d655da..a76f9a2f043a 100644
@@ -441,3 +441,4 @@
 547	x32	pwritev2		compat_sys_pwritev64v2
 # This is the end of the legacy x32 range.  Numbers 548 and above are
 # not special and are not to be used for x32-specific syscalls.
+548	common	mq_timedreceive2		sys_mq_timedreceive2
arch/xtensa/kernel/syscalls/syscall.tbl +1 -0
index a9bca4e484de..ae106ac97418 100644
@@ -442,3 +442,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2
scripts/syscall.tbl +1 -0
index 7a42b32b6577..282bfff83d59 100644
@@ -412,3 +412,4 @@
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
 471	common	rseq_slice_yield		sys_rseq_slice_yield
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
Signature · 1 line
2.43.0
#3 lore raw

PATCH v2 3/4 IPC: Prepared Documentation and test

In reply to Mathura_Kumar
---
 Documentation/userspace-api/index.rst  |   1 +
 Documentation/userspace-api/ipc.rst    | 222 +++++++
 tools/testing/selftests/ipc/.gitignore |   1 +
 tools/testing/selftests/ipc/Makefile   |   9 +-
 tools/testing/selftests/ipc/mq_peek.c  | 785 +++++++++++++++++++++++++
 5 files changed, 1017 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/userspace-api/ipc.rst
 create mode 100644 tools/testing/selftests/ipc/mq_peek.c
Documentation/userspace-api/index.rst +1 -0
index a68b1bea57a8..bf747a91e74a 100644
@@ -22,6 +22,7 @@ System calls
    ioctl/index
    mseal
    rseq
+   ipc
 
 Security-related interfaces
 ===========================
Documentation/userspace-api/ipc.rst new file +222 -0

222 lines not on this page · raw message

tools/testing/selftests/ipc/.gitignore +1 -0
index 9ed280e4c704..fe609d98ecb2 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 msgque_test
 msgque
+mq_peek
tools/testing/selftests/ipc/Makefile +8 -1
index 50e9c299fc4a..1a8b27127ca8 100644
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 uname_M := $(shell uname -m 2>/dev/null || echo not)
 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
+CC = gcc
+CFLAGS = -static -O2
 ifeq ($(ARCH),i386)
         ARCH := x86
 	CFLAGS := -DCONFIG_X86_32 -D__i386__
@@ -9,10 +11,15 @@ ifeq ($(ARCH),x86_64)
 	ARCH := x86
 	CFLAGS := -DCONFIG_X86_64 -D__x86_64__
 endif
+ifeq ($(ARCH),aarch64)
+        ARCH := arm64
+        CFLAGS := -DCONFIG_ARM64
+endif
 
 CFLAGS += $(KHDR_INCLUDES)
 
-TEST_GEN_PROGS := msgque
+TEST_GEN_PROGS := msgque mq_peek
+LDLIBS += -lrt -lpthread
 
 include ../lib.mk
 
tools/testing/selftests/ipc/mq_peek.c new file +785 -0

785 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

PATCH v2 4/4 IPC:Added entry in performance tools for new system call

In reply to Mathura_Kumar
---
 tools/perf/arch/alpha/entry/syscalls/syscall.tbl    | 1 +
 tools/perf/arch/arm/entry/syscalls/syscall.tbl      | 1 +
 tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl | 1 +
 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl | 1 +
 tools/perf/arch/parisc/entry/syscalls/syscall.tbl   | 1 +
 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl  | 1 +
 tools/perf/arch/s390/entry/syscalls/syscall.tbl     | 1 +
 tools/perf/arch/sh/entry/syscalls/syscall.tbl       | 1 +
 tools/perf/arch/sparc/entry/syscalls/syscall.tbl    | 1 +
 tools/perf/arch/x86/entry/syscalls/syscall_32.tbl   | 1 +
 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl   | 1 +
 tools/perf/arch/xtensa/entry/syscalls/syscall.tbl   | 1 +
 tools/scripts/syscall.tbl                           | 1 +
 13 files changed, 13 insertions(+)
tools/perf/arch/alpha/entry/syscalls/syscall.tbl +1 -0
index 74720667fe09..95893d9ec401 100644
@@ -502,3 +502,4 @@
 570	common	lsm_set_self_attr		sys_lsm_set_self_attr
 571	common	lsm_list_modules		sys_lsm_list_modules
 572	common  mseal				sys_mseal
+582	common	mq_timedreceive2		sys_mq_timedreceive2
tools/perf/arch/arm/entry/syscalls/syscall.tbl +1 -0
index fd09afae72a2..40b018f08f7d 100644
@@ -485,3 +485,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472	common	mq_timedreceive2		sys_mq_timedreceive2
tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl +1 -0
index 9a37930d4e26..0e9ff6deb3fa 100644
@@ -474,3 +474,4 @@
 460	common	lsm_set_self_attr		sys_lsm_set_self_attr
 461	common	lsm_list_modules		sys_lsm_list_modules
 462	common	mseal				sys_mseal
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
\ No newline at end of file
tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl +1 -0
index 9b92bddf06b5..154886e07e8b 100644
@@ -385,3 +385,4 @@
 468	n64	file_getattr			sys_file_getattr
 469	n64	file_setattr			sys_file_setattr
 470	n64	listns				sys_listns
+472	n64	mq_timedreceive2		sys_mq_timedreceive2
tools/perf/arch/parisc/entry/syscalls/syscall.tbl +1 -0
index 66dc406b12e4..f1741102631b 100644
@@ -461,3 +461,4 @@
 460	common	lsm_set_self_attr		sys_lsm_set_self_attr
 461	common	lsm_list_modules		sys_lsm_list_modules
 462	common	mseal				sys_mseal
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +1 -0
index ec4458cdb97b..9326132328bf 100644
@@ -561,3 +561,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/s390/entry/syscalls/syscall.tbl +1 -0
index 5863787ab036..003603fd789b 100644
@@ -473,3 +473,4 @@
 468  common	file_getattr		sys_file_getattr		sys_file_getattr
 469  common	file_setattr		sys_file_setattr		sys_file_setattr
 470  common	listns			sys_listns			sys_listns
+472	 common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/sh/entry/syscalls/syscall.tbl +1 -0
index 969c11325ade..af944271a813 100644
@@ -474,3 +474,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472	common	mq_timedreceive2		sys_mq_timedreceive2
tools/perf/arch/sparc/entry/syscalls/syscall.tbl +1 -0
index 39aa26b6a50b..7236b2158ae0 100644
@@ -516,3 +516,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/x86/entry/syscalls/syscall_32.tbl +1 -0
index e979a3eac7a3..a93f76e01232 100644
@@ -476,3 +476,4 @@
 468	i386	file_getattr		sys_file_getattr
 469	i386	file_setattr		sys_file_setattr
 470	i386	listns			sys_listns
+472	i386	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +1 -0
index 8a4ac4841be6..b6521fc1045b 100644
@@ -440,3 +440,4 @@
 547	x32	pwritev2		compat_sys_pwritev64v2
 # This is the end of the legacy x32 range.  Numbers 548 and above are
 # not special and are not to be used for x32-specific syscalls.
+548	common	mq_timedreceive2		sys_mq_timedreceive2		compat_sys_mq_timedreceive2
tools/perf/arch/xtensa/entry/syscalls/syscall.tbl +1 -0
index 438a3b170402..9525878dd8b1 100644
@@ -441,3 +441,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472	common	mq_timedreceive2		sys_mq_timedreceive2
tools/scripts/syscall.tbl +1 -0
index e74868be513c..576d34045747 100644
@@ -411,3 +411,4 @@
 468	common	file_getattr			sys_file_getattr
 469	common	file_setattr			sys_file_setattr
 470	common	listns				sys_listns
+472 common	mq_timedreceive2	sys_mq_timedreceive2	compat_sys_mq_timedreceive2
Signature · 1 line
2.43.0
#5 lore raw
In reply to Mathura_Kumar

Hi Mathura,

Quoted 8 lines · Mathura_Kumar

Patch series overview:

1. Add New system call do_mq_timedreceive2() and handler implementation
2. Add system call number in all most common arch.
3. Prepared Documentation and test
4. Add entry in performance tools all most common file

Quoted 6 lines

Short Description:

POSIX message queues currently lack a mechanism to read a message without removing it from the queue. This is a long-standing limitation,when we require inspection of queue state without altering it.

[...]

Thanks for your series!

Quoted 3 lines

change since v1:
- minor update, header guard was removed from include/uapi/linux/mqueue.h
- v1 Link: https://lore.kernel.org/all/[email protected]/T/#t

Weren't you at v5 before, so how did you get to v1 and v2 again? What has changed?

"[PATCH] [PATCH V5] mqueue: introduce new do_mq_timedreceive2() [ mq_peek syscall] for non-destructive receive and inspection,fix minor issue,prepared doc."
https://lore.kernel.org/[email protected]

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

A message that is not in the archive (sent off-list or not yet received): CA+QNo20REG+nJLCJBYtOJfsTiwr-7L637BJgP7XURE7QdJw=kA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CA+QNo23jM2_puZGi3FsiyU4VxMuqbTEuz9MaLKt58ss=VQz-nw@mail.gmail.com

author
#8 lore raw

Hi Geert Uytterhoeven,
Just forget everything that about work submitted in two weeks ago
Patch,that is a waste of time to talk, earlier work is messed up ,no
modularity , Please focus on the current version that has all related
information in the cover letter.
This is fresh work -
v1- https://lore.kernel.org/[email protected]
v2- https://lore.kernel.org/linux-arch/CAMuHMdV4MTNUmZdqMd+PhChDLL6yom2zj1bsiJfiK5+gr+j7Ow@mail.gmail.com/T/#t

I am resending this email as I was out of station earlier. The main list could not be submitted previously because plain text mode was not accessible on my phone.

Kindly review the resubmitted details.

Thank you for your understanding.

Quoted 62 lines · Mathura

Hi Greet,
Just forget everything that about work submitted in two weeks ago Patch,that is a waste of time to talk, earlier work is messed up ,no modularity , Please focus on the current version that has all related information in the cover letter. This is fresh work -
v1- https://lore.kernel.org/[email protected]
v2- https://lore.kernel.org/linux-arch/CAMuHMdV4MTNUmZdqMd+PhChDLL6yom2zj1bsiJfiK5+gr+j7Ow@mail.gmail.com/T/#t
Thanks

Quoted 53 lines · Mathura

I have discarded all previous work and earlier patches, as most of the implementation has been redone from scratch using a completely new approach. Therefore, please disregard the patches from two weeks ago and review this as a fresh series.

Thanks

Quoted 45 lines · Geert Uytterhoeven,

Hi Mathura,

Quoted 8 lines · Mathura_Kumar

Patch series overview:

1. Add New system call do_mq_timedreceive2() and handler implementation
2. Add system call number in all most common arch.
3. Prepared Documentation and test
4. Add entry in performance tools all most common file

Quoted 6 lines

Short Description:

POSIX message queues currently lack a mechanism to read a message without removing it from the queue. This is a long-standing limitation,when we require inspection of queue state without altering it.

[...]

Thanks for your series!

Quoted 3 lines

change since v1:
- minor update, header guard was removed from include/uapi/linux/mqueue.h
- v1 Link: https://lore.kernel.org/all/[email protected]/T/#t

Weren't you at v5 before, so how did you get to v1 and v2 again? What has changed?

"[PATCH] [PATCH V5] mqueue: introduce new do_mq_timedreceive2() [ mq_peek syscall] for non-destructive receive and inspection,fix minor issue,prepared doc."
https://lore.kernel.org/[email protected]

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author
#9 lore raw

For context, in the old series of patches, the following major serious implementation issues and minor issues were pointed out in feedback and I carefully handled all of them in this new series. The earlier series was messed up, and for some reason, after taking all the feedback in new one, I just want to move on from there so i started fresh new patch:

1) Busted implementation leading to bad user space pointer handling

2) Unnecessary obsolete time32 version

3) Some architectures have missing and inconsistent new syscall numbers in the table

4) Misc. minor issues

Thanks
Mathura

Quoted 82 lines · Mathura

Hi Geert Uytterhoeven,
Just forget everything that about work submitted in two weeks ago
Patch,that is a waste of time to talk, earlier work is messed up ,no
modularity , Please focus on the current version that has all related
information in the cover letter.
This is fresh work -
v1- https://lore.kernel.org/[email protected]
v2- https://lore.kernel.org/linux-arch/CAMuHMdV4MTNUmZdqMd+PhChDLL6yom2zj1bsiJfiK5+gr+j7Ow@mail.gmail.com/T/#t

I am resending this email as I was out of station earlier. The main list could not be submitted previously because plain text mode was not accessible on my phone.

Kindly review the resubmitted details.

Thank you for your understanding.

Quoted 62 lines · Mathura

Hi Greet,
Just forget everything that about work submitted in two weeks ago Patch,that is a waste of time to talk, earlier work is messed up ,no modularity , Please focus on the current version that has all related information in the cover letter. This is fresh work -
v1- https://lore.kernel.org/[email protected]
v2- https://lore.kernel.org/linux-arch/CAMuHMdV4MTNUmZdqMd+PhChDLL6yom2zj1bsiJfiK5+gr+j7Ow@mail.gmail.com/T/#t
Thanks

Quoted 53 lines · Mathura

I have discarded all previous work and earlier patches, as most of the implementation has been redone from scratch using a completely new approach. Therefore, please disregard the patches from two weeks ago and review this as a fresh series.

Thanks

Quoted 45 lines · Geert Uytterhoeven,

Hi Mathura,

Quoted 8 lines · Mathura_Kumar

Patch series overview:

1. Add New system call do_mq_timedreceive2() and handler implementation
2. Add system call number in all most common arch.
3. Prepared Documentation and test
4. Add entry in performance tools all most common file

Quoted 6 lines

Short Description:

POSIX message queues currently lack a mechanism to read a message without removing it from the queue. This is a long-standing limitation,when we require inspection of queue state without altering it.

[...]

Thanks for your series!

Quoted 3 lines

change since v1:
- minor update, header guard was removed from include/uapi/linux/mqueue.h
- v1 Link: https://lore.kernel.org/all/[email protected]/T/#t

Weren't you at v5 before, so how did you get to v1 and v2 again? What has changed?

"[PATCH] [PATCH V5] mqueue: introduce new do_mq_timedreceive2() [ mq_peek syscall] for non-destructive receive and inspection,fix minor issue,prepared doc."
https://lore.kernel.org/[email protected]

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds