diff mbox series

[2/3] fs/proc/array: Add Syscall User Dispatch to proc status

Message ID 20230123032942.18263-3-gregory.price@memverge.com (mailing list archive)
State New
Headers show
Series Checkpoint Support for Syscall User Dispatch | expand

Commit Message

Gregory Price Jan. 23, 2023, 3:29 a.m. UTC
Report the value of test_syscall_work(SYSCALL_USER_DISPATCH)) in
proc/status if GENERIC_ENTRY is enabled or the arch has implemented it.

This provides an indicator to userland checkpoint/restore software that
it must manage special signal conditions (similar to SECCOMP)

Signed-off-by: Gregory Price <gregory.price@memverge.com>
---
 fs/proc/array.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/fs/proc/array.c b/fs/proc/array.c
index 49283b8103c7..d4e4ee2409c6 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -428,6 +428,15 @@  static inline void task_thp_status(struct seq_file *m, struct mm_struct *mm)
 	seq_printf(m, "THP_enabled:\t%d\n", thp_enabled);
 }
 
+static inline void task_syscall_user_dispatch(struct seq_file *m,
+						struct task_struct *p)
+{
+#if defined(CONFIG_GENERIC_ENTRY) || defined(TIF_SYSCALL_USER_DISPATCH)
+	seq_put_decimal_ull(m, "\nSyscall_user_dispatch:\t",
+			    test_task_syscall_work(p, SYSCALL_USER_DISPATCH));
+#endif
+}
+
 int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
 			struct pid *pid, struct task_struct *task)
 {
@@ -451,6 +460,7 @@  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
 	task_cpus_allowed(m, task);
 	cpuset_task_status_allowed(m, task);
 	task_context_switch_counts(m, task);
+	task_syscall_user_dispatch(m, task);
 	return 0;
 }