Skip to contentSkip to conversation

fs-proc-do_task_stat-use-__for_each_thread.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Oct 4, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: fs/proc: do_task_stat: use __for_each_thread()
has been removed from the -mm tree. Its filename was
fs-proc-do_task_stat-use-__for_each_thread.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Oleg Nesterov <[email protected]>
Subject: fs/proc: do_task_stat: use __for_each_thread()
Date: Sat, 9 Sep 2023 18:45:01 +0200

do/while_each_thread should be avoided when possible.

---

 fs/proc/array.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/proc/array.c renamed from fs/proc/array.c~fs-proc-do_task_stat-use-__for_each_thread +4 -3
@@ -536,12 +536,13 @@ static int do_task_stat(struct seq_file
 
 		/* add up live thread stats at the group level */
 		if (whole) {
-			struct task_struct *t = task;
-			do {
+			struct task_struct *t;
+
+			__for_each_thread(sig, t) {
 				min_flt += t->min_flt;
 				maj_flt += t->maj_flt;
 				gtime += task_gtime(t);
-			} while_each_thread(task, t);
+			}
 
 			min_flt += sig->min_flt;
 			maj_flt += sig->maj_flt;

_

Patches currently in -mm which might be from [email protected] are