[PATCH v2 7/7] netclassid: use thread_group_leader(p) in update_classid_task()

Oleg Nesterov posted 7 patches 1 week, 5 days ago
[PATCH v2 7/7] netclassid: use thread_group_leader(p) in update_classid_task()
Posted by Oleg Nesterov 1 week, 5 days ago
Cleanup and preparation to simplify the next changes.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 net/core/netclassid_cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c
index dff66d8fb325..db9a5354f9de 100644
--- a/net/core/netclassid_cgroup.c
+++ b/net/core/netclassid_cgroup.c
@@ -93,7 +93,7 @@ static void update_classid_task(struct task_struct *p, u32 classid)
 	/* Only update the leader task, when many threads in this task,
 	 * so it can avoid the useless traversal.
 	 */
-	if (p != p->group_leader)
+	if (!thread_group_leader(p))
 		return;
 
 	do {
-- 
2.52.0
Re: [PATCH v2 7/7] netclassid: use thread_group_leader(p) in update_classid_task()
Posted by Andrew Morton 1 week, 4 days ago
On Sun, 25 Jan 2026 17:08:00 +0100 Oleg Nesterov <oleg@redhat.com> wrote:

> Cleanup and preparation to simplify the next changes.
> 

"next changes".  This is the final patch?

> --- a/net/core/netclassid_cgroup.c
> +++ b/net/core/netclassid_cgroup.c
> @@ -93,7 +93,7 @@ static void update_classid_task(struct task_struct *p, u32 classid)
>  	/* Only update the leader task, when many threads in this task,
>  	 * so it can avoid the useless traversal.
>  	 */
> -	if (p != p->group_leader)
> +	if (!thread_group_leader(p))
>  		return;
>  
>  	do {
> -- 
> 2.52.0
Re: [PATCH v2 7/7] netclassid: use thread_group_leader(p) in update_classid_task()
Posted by Andrew Morton 1 week, 4 days ago
On Mon, 26 Jan 2026 12:50:48 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Sun, 25 Jan 2026 17:08:00 +0100 Oleg Nesterov <oleg@redhat.com> wrote:
> 
> > Cleanup and preparation to simplify the next changes.
> > 
> 
> "next changes".  This is the final patch?

Ah, sorry, [0/n] explains.  I'll make that "planned future changes".
Re: [PATCH v2 7/7] netclassid: use thread_group_leader(p) in update_classid_task()
Posted by Jakub Kicinski 1 week, 5 days ago
On Sun, 25 Jan 2026 17:08:00 +0100 Oleg Nesterov wrote:
> Cleanup and preparation to simplify the next changes.

Acked-by: Jakub Kicinski <kuba@kernel.org>