pidfd: implement PIDFD_THREAD flag for pidfd_open()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest1 patch 17 repliesIn review
- v21 patch 3 repliesSuperseded
- v1 RFC1 patch 13 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | pidfd: implement PIDFD_THREAD flag for pidfd_open()fs/ include/ include/ +4 more | +54 | 13 replies |
Reviews trailers per patch
The patch has a Reviewed-by or Acked-by.
| Patch | Tycho Andersen |
|---|---|
| 1/1 | R-b T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/1] pidfd: implement PIDFD_THREAD flag for pidfd_open()
Please see the interdiff below.
Also, I updated the changelog to document that the behaviour of pidfd_poll(PIDFD_THREAD, pid-of-group-leader) is not well defined if a sub-thread execs.
Do you agree with this semantics?
Oleg.
---
fs/exec.c +5 -1
@@ -1143,7 +1143,11 @@ static int de_thread(struct task_struct *tsk)BUG_ON (leader->exit_state !=EXIT_ZOMBIE ); leader->exit_state =EXIT_DEAD ; - +/* +* leader and tsk exhanged their pids, the old pid dies, +* wake up the PIDFD_THREAD waiters. +*/ +do_notify_pidfd (leader);/* * We are going to release_task()->ptrace_unlink() silently, * the tracer can sleep in do_wait(). EXIT_DEAD guarantees
include/linux/pid.h +2 -1
@@ -70,10 +70,11 @@ extern const struct file_operations pidfd_fops;struct file ; -extern struct pid *pidfd_pid (const struct file *file); +struct pid *pidfd_pid (const struct file *file);struct pid *pidfd_get_pid (unsigned int fd,unsigned int *flags);struct task_struct *pidfd_get_task (int pidfd,unsigned int *flags);int pidfd_prepare (struct pid *pid,unsigned int flags,struct file **ret); +void do_notify_pidfd (struct task_struct *task);static inline struct pid *get_pid (struct pid *pid) {
kernel/signal.c +1 -1
@@ -2019,7 +2019,7 @@ int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type)return ret; } -static void do_notify_pidfd (struct task_struct *task) +void do_notify_pidfd (struct task_struct *task) {struct pid *pid;