mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] exit: kill signal_struct->quick_threads
@ 2024-06-09 14:23 Oleg Nesterov
  2024-06-09 14:24 ` [PATCH 1/1] " Oleg Nesterov
                   ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Oleg Nesterov @ 2024-06-09 14:23 UTC (permalink / raw)
  To: Andrew Morton, Eric W. Biederman, Tejun Heo; +Cc: linux-kernel

Hello,

Eric, I can't understand why the commit ("signal: Guarantee that
SIGNAL_GROUP_EXIT is set on process exit") added the new
quick_threads counter. And why, if we forget about --quick_threads,
synchronize_group_exit() has to take siglock unconditionally.
Did I miss something obvious?

Tejun, could you check the note about css_task_iter_advance() in
the changelog? And can't it use thread_group_empty() instead?

Oleg.


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [PATCH 00/17] exit: Making task exiting a first class concept
@ 2022-01-03 21:30 Eric W. Biederman
  2022-01-03 21:33 ` [PATCH 16/17] signal: Record the exit_code when an exit is scheduled Eric W. Biederman
  0 siblings, 1 reply; 47+ messages in thread
From: Eric W. Biederman @ 2022-01-03 21:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Linus Torvalds, Alexey Gladkov, Kyle Huey,
	Oleg Nesterov, Kees Cook, Al Viro, linux-api


The changes below contain some cleanups and the work to make implement
first class asynchronous task exit.  Most of the cleanups are necessary
for this work but a couple of them (removing profile_task_exit and the
extra setting of PT_SEIZED in ptrace_attach) are included because I
stumbled over them and they are worth applying but they aren't
interesting enough to me to make be in their own patchset.

The core of this set of changes is the addition of
schedule_task_exit_locked.  Ptrace is cleaned up to avoid a conflict in
task->exit_code.  Then the existing task exit code is gradually moved
into the final shape of schedule_task_exit_locked.

This is the fundamental building block I need to fix alpha, m68k,
nios2 and any other architecture that does not always save all of
their registers except when entering into a ptrace context.

This is about half the work to allow coredump signals to use
short-circuit delivery.

With coredumps signals available for short-circuit delivery the
SA_IMMUTABLE hack can be replace by something clean.

The counting of the number of threads that have not been killed to
always set SIGNAL_GROUP_EXIT when a process exits and the coredump
signal short-circuit delivery is a foundation for updating the
SECCOMP_RET_KILL_THREAD implementation such that it can decide if it
should coredump without races.

I have most of those changes pretty much ready I just need to get these
changes finalized reviewed first.  At this point they are looking at
v5.18 material.

These patches are on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git/ signal-for-v5.17

After these patches have been reviewed it is my plan to apply them to my
signal-for-v5.17 branch.  Any and all feedback is welcome.

Eric W. Biederman (17):
      exit: Remove profile_task_exit & profile_munmap
      exit: Coredumps reach do_group_exit
      exit: Fix the exit_code for wait_task_zombie
      exit: Use the correct exit_code in /proc/<pid>/stat
      taskstats: Cleanup the use of task->exit_code
      ptrace: Remove second setting of PT_SEIZED in ptrace_attach
      ptrace: Remove unused regs argument from ptrace_report_syscall
      ptrace/m68k: Stop open coding ptrace_report_syscall
      ptrace: Move setting/clearing ptrace_message into prace_stop
      ptrace: Return the signal to continue with from ptrace_stop
      ptrace: Separate task->ptrace_code out from task->exit_code
      signal: Compute the process exit_code in get_signal
      signal: Make individual tasks exiting a first class concept
      signal: Remove zap_other_threads
      signal: Add JOBCTL_WILL_EXIT to mark exiting tasks
      signal: Record the exit_code when an exit is scheduled
      signal: Always set SIGNAL_GROUP_EXIT on process exit

 arch/m68k/kernel/ptrace.c    |  12 +----
 fs/coredump.c                |  17 +++---
 fs/exec.c                    |  12 +++--
 fs/proc/array.c              |   9 +++-
 include/linux/profile.h      |  26 ---------
 include/linux/ptrace.h       |   5 +-
 include/linux/sched.h        |   1 +
 include/linux/sched/jobctl.h |   2 +
 include/linux/sched/signal.h |   6 ++-
 include/linux/tracehook.h    |  21 ++++----
 kernel/exit.c                |  29 +++++-----
 kernel/fork.c                |   2 +
 kernel/profile.c             |  50 ------------------
 kernel/ptrace.c              |  14 +++--
 kernel/signal.c              | 122 +++++++++++++++++++++++--------------------
 kernel/tsacct.c              |   7 ++-
 mm/mmap.c                    |   1 -
 17 files changed, 134 insertions(+), 202 deletions(-)


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2024-06-30 14:01 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-09 14:23 [PATCH 0/1] exit: kill signal_struct->quick_threads Oleg Nesterov
2024-06-09 14:24 ` [PATCH 1/1] " Oleg Nesterov
2024-06-09 18:28 ` [PATCH 0/1] " Oleg Nesterov
2024-06-10 10:50 ` Q: css_task_iter_advance() && dying_tasks Oleg Nesterov
2024-06-10 11:08   ` Oleg Nesterov
2024-06-10 20:02     ` Tejun Heo
2024-06-10 20:00   ` Tejun Heo
2024-06-10 12:15 ` [PATCH 0/1] exit: kill signal_struct->quick_threads Eric W. Biederman
2024-06-10 15:29   ` Oleg Nesterov
2024-06-10 15:42     ` Oleg Nesterov
2024-06-10 16:18     ` Oleg Nesterov
2024-06-13 15:45     ` Oleg Nesterov
2024-06-15 14:53       ` Eric W. Biederman
2024-06-17 18:37         ` Oleg Nesterov
2024-06-19  3:48           ` Eric W. Biederman
2024-06-19  4:04             ` [PATCH 0/17] exit: complete synchronize_group_exit Eric W. Biederman
2024-06-19  4:05               ` [PATCH 01/17] signal: Make SIGKILL during coredumps an explicit special case Eric W. Biederman
2024-06-19 15:50                 ` Oleg Nesterov
2024-06-19 18:09                   ` Eric W. Biederman
2024-06-19 19:11                     ` Oleg Nesterov
2024-06-21  5:46                       ` Eric W. Biederman
2024-06-21 10:40                         ` Oleg Nesterov
2024-06-21 16:30                           ` Eric W. Biederman
2024-06-19  4:05               ` [PATCH 02/17] signal: Compute the process exit_code in get_signal Eric W. Biederman
2024-06-25 12:34                 ` Oleg Nesterov
2024-06-19  4:06               ` [PATCH 03/17] coredump: Consolidate the work to allow SIGKILL during coredumps Eric W. Biederman
2024-06-25 12:34                 ` Oleg Nesterov
2024-06-19  4:06               ` [PATCH 04/17] signal: In get_signal call do_exit when it is unnecessary to shoot down threads Eric W. Biederman
2024-06-25 12:35                 ` Oleg Nesterov
2024-06-19  4:07               ` [PATCH 05/17] signal: Bring down all threads when handling a non-coredump fatal signal Eric W. Biederman
2024-06-25 12:56                 ` Oleg Nesterov
2024-06-19  4:07               ` [PATCH 06/17] signal: Add JOBCTL_WILL_EXIT to mark exiting tasks Eric W. Biederman
2024-06-19  4:08               ` [PATCH 07/17] signal: Always set JOBCTL_WILL_EXIT for " Eric W. Biederman
2024-06-30 14:00                 ` kernel test robot
2024-06-19  4:08               ` [PATCH 08/17] signal: Don't target tasks that are exiting Eric W. Biederman
2024-06-19  4:09               ` [PATCH 09/17] signal: Test for process exit or de_thread using task_exit_pending Eric W. Biederman
2024-06-19  4:09               ` [PATCH 10/17] signal: Only set JOBCTL_WILL_EXIT if it is not already set Eric W. Biederman
2024-06-19  4:10               ` [PATCH 11/17] signal: Make individual tasks exiting a first class concept Eric W. Biederman
2024-06-19  4:10               ` [PATCH 12/17] signal: Remove zap_other_threads Eric W. Biederman
2024-06-19  4:11               ` [PATCH 13/17] signal: Stop skipping current in do_group_exit & get_signal Eric W. Biederman
2024-06-28  5:43                 ` kernel test robot
2024-06-19  4:11               ` [PATCH 14/17] signal: Factor out schedule_group_exit_locked Eric W. Biederman
2024-06-19  4:12               ` [PATCH 15/17] ptrace: Separate task->ptrace_code out from task->exit_code Eric W. Biederman
2024-06-19  4:12               ` [PATCH 16/17] signal: Record the exit_code when an exit is scheduled Eric W. Biederman
2024-06-19  4:13               ` [PATCH 17/17] signal: Set SIGNAL_GROUP_EXIT when all tasks have decided to exit Eric W. Biederman
2024-06-19 20:18             ` [PATCH 0/1] exit: kill signal_struct->quick_threads Oleg Nesterov
  -- strict thread matches above, loose matches on Subject: below --
2022-01-03 21:30 [PATCH 00/17] exit: Making task exiting a first class concept Eric W. Biederman
2022-01-03 21:33 ` [PATCH 16/17] signal: Record the exit_code when an exit is scheduled Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®