Skip to contentSkip to conversation

change-thread_group_empty-to-use-task_struct-thread_node.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: change thread_group_empty() to use task_struct->thread_node

has been removed from the -mm tree. Its filename was
change-thread_group_empty-to-use-task_struct-thread_node.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: change thread_group_empty() to use task_struct->thread_node
Date: Sat, 26 Aug 2023 13:14:06 +0200

Patch series "kill task_struct->thread_group".

This patch (of 2):

It could use list_is_singular() but this way it is cheaper. Plus the thread_group_leader() check makes it clear that thread_group_empty() can only return true if p is a group leader. This was not immediately obvious before this patch.

task_struct->thread_group no longer has users, it can die.

---

 include/linux/sched/signal.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/sched/signal.h renamed from include/linux/sched/signal.h~change-thread_group_empty-to-use-task_struct-thread_node +2 -1
@@ -733,7 +733,8 @@ static inline struct task_struct *next_t
 
 static inline int thread_group_empty(struct task_struct *p)
 {
-	return list_empty(&p->thread_group);
+	return thread_group_leader(p) &&
+	       list_is_last(&p->thread_node, &p->signal->thread_head);
 }
 
 #define delay_group_leader(p) \

_

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