linux-stable/arch
Oleg Nesterov 5ffd2c37cb kill do_each_thread()
Eric has pointed out that we still have 3 users of do_each_thread().
Change them to use for_each_process_thread() and kill this helper.

There is a subtle change, after do_each_thread/while_each_thread g == t ==
&init_task, while after for_each_process_thread() they both point to
nowhere, but this doesn't matter.

> Why is for_each_process_thread() better than do_each_thread()?

Say, for_each_process_thread() is rcu safe, do_each_thread() is not.

And certainly

	for_each_process_thread(p, t) {
		do_something(p, t);
	}

looks better than

	do_each_thread(p, t) {
		do_something(p, t);
	} while_each_thread(p, t);

And again, there are only 3 users of this awkward helper left.  It should
have been killed years ago and in fact I thought it had already been
killed.  It uses while_each_thread() which needs some changes.

Link: https://lkml.kernel.org/r/20230817163708.GA8248@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: "Christian Brauner (Microsoft)" <brauner@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jiri Slaby <jirislaby@kernel.org> # tty/serial
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-08-21 13:46:25 -07:00
..
alpha Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
arc treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
arm treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
arm64 arm64/kexec: refactor for kernel/Kconfig.kexec 2023-08-18 10:18:52 -07:00
csky arch/csky patches for 6.5 2023-07-01 21:12:32 -07:00
hexagon treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
ia64 kill do_each_thread() 2023-08-21 13:46:25 -07:00
loongarch nmi_backtrace: allow excluding an arbitrary CPU 2023-08-18 10:19:00 -07:00
m68k treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
microblaze treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
mips treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
nios2 treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
openrisc treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
parisc parisc/kexec: refactor for kernel/Kconfig.kexec 2023-08-18 10:18:53 -07:00
powerpc treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
riscv treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
s390 remove ARCH_DEFAULT_KEXEC from Kconfig.kexec 2023-08-18 10:18:55 -07:00
sh treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
sparc nmi_backtrace: allow excluding an arbitrary CPU 2023-08-18 10:19:00 -07:00
um arch/*/configs/*defconfig: Replace AUTOFS4_FS by AUTOFS_FS 2023-07-29 14:08:22 -07:00
x86 lockdep: fix static memory detection even more 2023-08-21 13:46:24 -07:00
xtensa treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
.gitignore
Kconfig arch: enable HAS_LTO_CLANG with KASAN and KCOV 2023-08-18 10:18:56 -07:00