From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D446C2ED848 for ; Sun, 7 Dec 2025 12:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111164; cv=none; b=MHWaKjsG5zt6KlRxJ2XmvB7ztCn/sIVe/kq7BLcC34wvrrdfRdRUhm6XygDEx7kkr79OWFsg9v6AIWWdLLHfpo6I2LcqmISLOsZrn3zaCXl4OvBReYBL0Mg+GL3jEQolmQhUW3bFkqOeZ0b0knFCcXskcdj16X9iufg06Gx536A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111164; c=relaxed/simple; bh=6bJAp3FtnBT0Hpdk8297wzdwh4zG3qxVQVHhDbz1oig=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Vr6770mDON7YvdoEKEcd6+zR9mWtlwAM1aHgkGp8lP6gAFWQ2YWfpoyQ79LNIU4U+wyqwEa5g7uj4ABjqq+25nNW5phk6VreA8rdNlveaUKZWggB9alwzPp6BcbREihNo0bYq/QsBpZIgSUhsXFAwGFdUku1IbhMKETsBI3egr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fm45IYKI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fm45IYKI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=EsBQW8HxAVAKrwqsykmMqSqPHf2ZEI/TGurllEoeIZc=; b=fm45IYKIHBGafoCwBHLNTTydqE8bXNcyLz2DXI1EeSiJmA21fz2q8FyR12eoaDra/ZSCiK MA2GG0QqFY1BEnKEtOz7aQ31hgoGcy/ttJrFmfx2QDa6UP4VsCwJ4BSnQm0aiSAdMTfkTW B1BF0G5VSDoRn+j+20EQ5INnuiMz6+A= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-576-mgcHMoYVOeuGRxXPF14XEQ-1; Sun, 07 Dec 2025 07:39:18 -0500 X-MC-Unique: mgcHMoYVOeuGRxXPF14XEQ-1 X-Mimecast-MFC-AGG-ID: mgcHMoYVOeuGRxXPF14XEQ_1765111155 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 61B691956053; Sun, 7 Dec 2025 12:39:14 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id E641B1953986; Sun, 7 Dec 2025 12:39:03 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:39:16 +0100 (CET) Date: Sun, 7 Dec 2025 13:39:04 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/7] android/binder: don't abuse current->group_leader Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. - Use current->tgid instead of current->group_leader->pid - Use the value returned by get_task_struct() to initialize proc->tsk Signed-off-by: Oleg Nesterov Reviewed-by: Alice Ryhl --- drivers/android/binder.c | 7 +++---- drivers/android/binder_alloc.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index a3a1b5c33ba3..a00f6678f04d 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6044,7 +6044,7 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) bool existing_pid =3D false; =20 binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__, - current->group_leader->pid, current->pid); + current->tgid, current->pid); =20 proc =3D kzalloc(sizeof(*proc), GFP_KERNEL); if (proc =3D=3D NULL) @@ -6053,8 +6053,8 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) dbitmap_init(&proc->dmap); spin_lock_init(&proc->inner_lock); spin_lock_init(&proc->outer_lock); - get_task_struct(current->group_leader); - proc->tsk =3D current->group_leader; + proc->tsk =3D get_task_struct(current->group_leader); + proc->pid =3D current->tgid; proc->cred =3D get_cred(filp->f_cred); INIT_LIST_HEAD(&proc->todo); init_waitqueue_head(&proc->freeze_wait); @@ -6073,7 +6073,6 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) binder_alloc_init(&proc->alloc); =20 binder_stats_created(BINDER_STAT_PROC); - proc->pid =3D current->group_leader->pid; INIT_LIST_HEAD(&proc->delivered_death); INIT_LIST_HEAD(&proc->delivered_freeze); INIT_LIST_HEAD(&proc->waiting_threads); diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 979c96b74cad..145ed5f14cdb 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -1233,7 +1233,7 @@ static struct shrinker *binder_shrinker; VISIBLE_IF_KUNIT void __binder_alloc_init(struct binder_alloc *alloc, struct list_lru *freelist) { - alloc->pid =3D current->group_leader->pid; + alloc->pid =3D current->tgid; alloc->mm =3D current->mm; mmgrab(alloc->mm); mutex_init(&alloc->mutex); --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B12732ECE93 for ; Sun, 7 Dec 2025 12:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111176; cv=none; b=rMiTxv9Ok+CI8q1IK0YSnS1fShGwHWZlSAhqTwkNhSfiH6mntkok1oIceov5T9Q7UR/rOD+WIY+BZb9EheFr0Tjml0QW66AoQsip80IqWdHW68jCCawRc+uvPwT+H269RBBMNbf8hRZlE3IBk+edMyUb+NX3e8ksOFKjt3hqYmo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111176; c=relaxed/simple; bh=3aC+u0nuPMsrqkVloCDN63ABR3XLIyUV3vUQuLukUCw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=rYmaXW2PFgXzsvhtnSuXbbUpMUgX3Qq6Q4rkykTBpHYEdO/s9bbCp0+EjnIcHZY1thHBiaOl+H49CYKRtJty+QlyqOiWG9MG5exZR6RQnG897lNUnLYJcDzcMpTEfUCfXyk8XXKrkXc3mz+sAPUst2ttUsrKFYHGSrYYRsWvb5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gkmY0U0F; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gkmY0U0F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=FXlhOdfvxpvaaDvBl5X+h/hsx7G14jGyMV7HWDsiG0A=; b=gkmY0U0FJ+nZxO4Q5bmC9wuGc6N9Enr6oCjCou6UiR+u1cRhzfyj/XZgW1rIFnUTGWSLKD 7lzP2Sy5K0oDAiXLpjzuKfUk0OD5OByy6JFEkIcbji9VQv06Q57UG+4e3YvbV7pc4CSIAA 52IIp2g3biIFmXwn45/1AkDSKF2tKZY= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-507-MnXhMlg-NOGbLn5AUANwSg-1; Sun, 07 Dec 2025 07:39:29 -0500 X-MC-Unique: MnXhMlg-NOGbLn5AUANwSg-1 X-Mimecast-MFC-AGG-ID: MnXhMlg-NOGbLn5AUANwSg_1765111166 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 543F91956052; Sun, 7 Dec 2025 12:39:26 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 7F53119560BD; Sun, 7 Dec 2025 12:39:16 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:39:28 +0100 (CET) Date: Sun, 7 Dec 2025 13:39:17 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 2/7] android/binder: use same_thread_group(proc->tsk, current) in binder_mmap() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With or without this change the checked condition can be falsely true if proc->tsk execs, but this is fine: binder_alloc_mmap_handler() checks vma->vm_mm =3D=3D alloc->mm. Signed-off-by: Oleg Nesterov Reviewed-by: Alice Ryhl --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index a00f6678f04d..980bb13228fc 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6013,7 +6013,7 @@ static int binder_mmap(struct file *filp, struct vm_a= rea_struct *vma) { struct binder_proc *proc =3D filp->private_data; =20 - if (proc->tsk !=3D current->group_leader) + if (!same_thread_group(proc->tsk, current)) return -EINVAL; =20 binder_debug(BINDER_DEBUG_OPEN_CLOSE, --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF6F92ED161 for ; Sun, 7 Dec 2025 12:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111190; cv=none; b=MLMNyymzVKlF2oP8A9x/QvCflkjqppAYLAifvwOzspUReOQ6c4MbeCOjjzQyGZWNgTc7uoDyiYz5Wmm+TDQH0jlVVGpOL/hDT1AWiwCITnyqge2duG1ekGp49oXm+fmlARPBzio3IAzAxxibQBQsL4i23RWXtf1RTSJ8S02078w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111190; c=relaxed/simple; bh=X8LerOgNIhp61xDqaOmC/06/ifz39whdlSV6H/A+jyU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Qg/GCYTD6XvgU8pBg9ueCJvMkEQVOGWVWr0994f7rEuNND+gcQEx1HYnxyORrGji2BtzjOEkqF+bDavQ6Ai54vf6B0ZEv3iyB4MZ0nRj2FUU9d3KzL34/uCrZRIVghwKCA+gSEvzK0KtkfQ1M7Eagajpk8ME2qSM1PEt0o8C9Ms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Vc3eR/lq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Vc3eR/lq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=GspPLneNRfjxjLHV+P4c99mYW0S2jOEzAxTTs5yzofc=; b=Vc3eR/lqeFTmkhf7tmkpjPqjxS7UcgaDydCGNygd9uESEcRT2dic35h03LDya3cNto1JZ+ hCkZwUN0rx3hkQMaw9P6Cpn5LQV2LsRcm7E4D+usWKRKieuP/jKXo90MmNtj+fOEamQ4ts 37/fRs1tAkdhSk3Mamt40KwDkZJ1Q5k= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-314-4yRwVArNN0eXDh1QrB5yKA-1; Sun, 07 Dec 2025 07:39:42 -0500 X-MC-Unique: 4yRwVArNN0eXDh1QrB5yKA-1 X-Mimecast-MFC-AGG-ID: 4yRwVArNN0eXDh1QrB5yKA_1765111179 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74B3E18001C6; Sun, 7 Dec 2025 12:39:38 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 48A00180044F; Sun, 7 Dec 2025 12:39:27 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:39:40 +0100 (CET) Date: Sun, 7 Dec 2025 13:39:28 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 3/7] drm/amdgpu: don't abuse current->group_leader Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. - Use current->tgid instead of current->group_leader->pid - Use get_task_pid(current, PIDTYPE_TGID) instead of get_task_pid(current->group_leader, PIDTYPE_PID) Signed-off-by: Oleg Nesterov Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu= /drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index b1c24c8fa686..df22b54ba346 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -1421,7 +1421,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **p= rocess_info, goto create_evict_fence_fail; } =20 - info->pid =3D get_task_pid(current->group_leader, PIDTYPE_PID); + info->pid =3D get_task_pid(current, PIDTYPE_TGID); INIT_DELAYED_WORK(&info->restore_userptr_work, amdgpu_amdkfd_restore_userptr_worker); =20 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/a= mdgpu/amdgpu_vm.c index a67285118c37..a0f8ba382b9e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2554,7 +2554,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm) if (current->group_leader->mm !=3D current->mm) return; =20 - vm->task_info->tgid =3D current->group_leader->pid; + vm->task_info->tgid =3D current->tgid; get_task_comm(vm->task_info->process_name, current->group_leader); } =20 --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2FD219049B for ; Sun, 7 Dec 2025 12:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111200; cv=none; b=QdmID7+fBQEGx30lQtfkuLCbKRKsAKTxh3LeLOv0AWW3MY7NV4UxxlQ7B6L/L50elJ+v0X/pSS9AxrRDPYfxjh0r0DgX85JVT8wZfKQovxUiKUWKcsuOR9GPwA74wsPIq6VdLJaZ8GLnp0Ksq3QaI4A3mr6icTuruqRTHuCyQP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111200; c=relaxed/simple; bh=Ytz+SZqOIW+Xy5xzf61tHStbY6EtoqoLzDhjnRsCsAk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=WdY5vJtiuCL9xPXW6ij4CqTOLpG252rZvCjdJ68IYIhQizfR2L3fq1FE0OF4tbGgo7HbxKIyJxhhNrHMGS4aoSLE7VqWxjwI6n8Gf4VoFj8F+J6DVCwT8ebmWkPo9Va1aEkctYZ5NeWYPzTIsYOnDLjaJIJ/gBoPwk2Jyy3VMwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=f8q3++9s; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="f8q3++9s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=rgXA81QLeZ8uxrq5YssERSuP8GaYN0hU+8W5qT5Vtak=; b=f8q3++9sODGQn7h6GPzcrH0t6IqxQcKsonevjTZjPzJ+kUGYeRN4lIaAX1sys4uPdgqSU1 EpJBFKU6cBElUvsUhbtHvqZAtZqXoygAA0zGnu14+oxLpvXjTXoIL0RdiukYY9ifhsgrwS 6XFVaR0vwAaq62VOxTcHR9K4sVDCK1U= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-PXj43SbAMtaj8nAdWGYIEA-1; Sun, 07 Dec 2025 07:39:54 -0500 X-MC-Unique: PXj43SbAMtaj8nAdWGYIEA-1 X-Mimecast-MFC-AGG-ID: PXj43SbAMtaj8nAdWGYIEA_1765111191 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8766018002C0; Sun, 7 Dec 2025 12:39:50 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 76BD5180044F; Sun, 7 Dec 2025 12:39:40 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:39:52 +0100 (CET) Date: Sun, 7 Dec 2025 13:39:41 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 4/7] drm/amd: kill the outdated "Only the pthreads threading model is supported" checks Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Nowaday task->group_leader->mm !=3D task->mm is only possible if a) task is not a group leader and b) task->group_leader->mm =3D=3D NULL because task->group_leader has already exited using sys_exit(). I don't think that drm/amd tries to detect/nack this case. Signed-off-by: Oleg Nesterov Acked-by: Felix Kuehling Reviewed-by: Christian K=C3=B6nig --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/a= mdgpu/amdgpu_vm.c index a0f8ba382b9e..e44f158a11f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2551,9 +2551,6 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm) vm->task_info->task.pid =3D current->pid; get_task_comm(vm->task_info->task.comm, current); =20 - if (current->group_leader->mm !=3D current->mm) - return; - vm->task_info->tgid =3D current->tgid; get_task_comm(vm->task_info->process_name, current->group_leader); } diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd= /amdkfd/kfd_process.c index a085faac9fe1..f8ef18a3aa71 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -833,12 +833,6 @@ struct kfd_process *kfd_create_process(struct task_str= uct *thread) if (!(thread->mm && mmget_not_zero(thread->mm))) return ERR_PTR(-EINVAL); =20 - /* Only the pthreads threading model is supported. */ - if (thread->group_leader->mm !=3D thread->mm) { - mmput(thread->mm); - return ERR_PTR(-EINVAL); - } - /* If the process just called exec(3), it is possible that the * cleanup of the kfd_process (following the release of the mm * of the old process image) is still in the cleanup work queue. @@ -918,10 +912,6 @@ struct kfd_process *kfd_get_process(const struct task_= struct *thread) if (!thread->mm) return ERR_PTR(-EINVAL); =20 - /* Only the pthreads threading model is supported. */ - if (thread->group_leader->mm !=3D thread->mm) - return ERR_PTR(-EINVAL); - process =3D find_process(thread, false); if (!process) return ERR_PTR(-EINVAL); --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69F372ECEA5 for ; Sun, 7 Dec 2025 12:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111212; cv=none; b=X/DFuHtGQKHbKI7yxpTEJ0fNo9ytmLprtUw634IWHdncGxbwqtyKHgwGY7i0WN9GqxD2C3eBmIehvOYyNzToU70CufdF0s6Ta+Zt5oKVwrLbQPnYQRzAEAraj8IcKbkWQ8Q+1x5o6XDqaU7mAqR5lzqsx+wQqTmZCCVGLaVrVpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111212; c=relaxed/simple; bh=YTH3r3peosgWPKyoUacL9XewNPCT/1k4nAgk7xQQ9XY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=Yao2sjD5dm4vLbNA3fbcyvDGUtep3T5R+9VvfXIPcINzp3BxgZ6yGuW9VyxNd4+sXmXyH3Fr53xzo8awhoXNA1md4jJDpnKQktwtSID1Eb+XmdvvUaAEHVq6d0HN4uYHajQwCLlIPVqP2ctikc73AzIHFYWGbi0+VR27DSjVDPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dKkoz22W; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dKkoz22W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=qm2SST2ROvbrb0g6IbjuLKtf6ZL8lExfalWyhBUzXok=; b=dKkoz22WC5aEvuYek6pHMN7vnMIHILLnD5Q52kat1gJso3UiH9kauu7egyYDUTbP6jHD1V il8o9C8UrChDQYvkPeFvAELALnP+ReSTlsxLL/SNJfy7BWpUU61mX3D6ukqqMFkCB3ohy1 zy7RALSV1cS0321ZXTpmx7zs9ZeF0CY= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-265-PbT8magNPuOajFBJKgpfeA-1; Sun, 07 Dec 2025 07:40:06 -0500 X-MC-Unique: PbT8magNPuOajFBJKgpfeA-1 X-Mimecast-MFC-AGG-ID: PbT8magNPuOajFBJKgpfeA_1765111202 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D9241956095; Sun, 7 Dec 2025 12:40:02 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 8A21F3011A86; Sun, 7 Dec 2025 12:39:52 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:40:04 +0100 (CET) Date: Sun, 7 Dec 2025 13:39:53 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 5/7] drm/pan*: don't abuse current->group_leader Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. Use current->tgid instead of current->group_leader->pid. Signed-off-by: Oleg Nesterov Acked-by: Boris Brezillon Acked-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +- drivers/gpu/drm/panthor/panthor_gem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panf= rost/panfrost_gem.c index 8041b65c6609..1ff1f2c8b726 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -17,7 +17,7 @@ static void panfrost_gem_debugfs_bo_add(struct panfrost_device *pfdev, struct panfrost_gem_object *bo) { - bo->debugfs.creator.tgid =3D current->group_leader->pid; + bo->debugfs.creator.tgid =3D current->tgid; get_task_comm(bo->debugfs.creator.process_name, current->group_leader); =20 mutex_lock(&pfdev->debugfs.gems_lock); diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/pantho= r/panthor_gem.c index fbde78db270a..29cc57efc4b9 100644 --- a/drivers/gpu/drm/panthor/panthor_gem.c +++ b/drivers/gpu/drm/panthor/panthor_gem.c @@ -27,7 +27,7 @@ static void panthor_gem_debugfs_bo_add(struct panthor_gem= _object *bo) struct panthor_device *ptdev =3D container_of(bo->base.base.dev, struct panthor_device, base); =20 - bo->debugfs.creator.tgid =3D current->group_leader->pid; + bo->debugfs.creator.tgid =3D current->tgid; get_task_comm(bo->debugfs.creator.process_name, current->group_leader); =20 mutex_lock(&ptdev->gems.lock); --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E17DC2ED858 for ; Sun, 7 Dec 2025 12:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111225; cv=none; b=qpb3LWcdXNV5cqSqcg15DIasZRTIDfK+nzgRVZkrL4PG7fJLpgdPgjKnPTnZ2ays8zPv4SuAkbgbglTA0zBPHc0jmjmpMYsTAHfZLeOhWZWF+seMkE1/oyP+9NpGha2iuBmeWyC1oz4EAhwdlKahiVGk+GbiRsCKqMbtCF/bjUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111225; c=relaxed/simple; bh=vfs6N9sDwumAAjFelXXmUF2gA0S98gkOcwdpB5QXLUc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=EQ8mdbaILwgEFeEpcXMhDM/6AoF89cjNi+7J4De2KeXg7PNzaDJfkQLn/XrLxWbrVoCv4A22GPFflb60srHTaYY8gp32kTrB5LIiiIMnJSG2KJh1c7qwpGEGudJxreyDmKeblDy9RGyEVoyuZgKiPqTnlbf/JZ9fL+6yXD3qTVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=NbDtsgoq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NbDtsgoq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=/HKvmdPqRZHJ9/v9r83b5lWZWkfSL/6IdXrUhiE9JhQ=; b=NbDtsgoqAzN9NWsfC5cJ7Sl9Ee99Bx/S/0WHS3NNpxnyEdihLtOpqrX0VtVU5WAdGa1Hc9 0sC7zJA6gzPfDZu/hCiQ1iYP5KBOkdV0WNh0oSxkZoW3uywT2TxkZrvo8W9Nbr+8mpncgO GKkmEvVOrw+XJ1jOLvXUv8oPIxlqJ8E= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-lKGezg7JN4ahQWbzy3fjVQ-1; Sun, 07 Dec 2025 07:40:18 -0500 X-MC-Unique: lKGezg7JN4ahQWbzy3fjVQ-1 X-Mimecast-MFC-AGG-ID: lKGezg7JN4ahQWbzy3fjVQ_1765111214 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 98FA018002EC; Sun, 7 Dec 2025 12:40:14 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 852F6180044F; Sun, 7 Dec 2025 12:40:04 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:40:16 +0100 (CET) Date: Sun, 7 Dec 2025 13:40:05 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 6/7] RDMA/umem: don't abuse current->group_leader Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. Use current->tgid instead of current->group_leader->pid. Signed-off-by: Oleg Nesterov --- drivers/infiniband/core/umem_odp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/u= mem_odp.c index 572a91a62a7b..32267258a19c 100644 --- a/drivers/infiniband/core/umem_odp.c +++ b/drivers/infiniband/core/umem_odp.c @@ -149,7 +149,7 @@ struct ib_umem_odp *ib_umem_odp_alloc_implicit(struct i= b_device *device, umem->owning_mm =3D current->mm; umem_odp->page_shift =3D PAGE_SHIFT; =20 - umem_odp->tgid =3D get_task_pid(current->group_leader, PIDTYPE_PID); + umem_odp->tgid =3D get_task_pid(current, PIDTYPE_TGID); ib_init_umem_implicit_odp(umem_odp); return umem_odp; } @@ -258,7 +258,7 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *d= evice, umem_odp->page_shift =3D HPAGE_SHIFT; #endif =20 - umem_odp->tgid =3D get_task_pid(current->group_leader, PIDTYPE_PID); + umem_odp->tgid =3D get_task_pid(current, PIDTYPE_TGID); ret =3D ib_init_umem_odp(umem_odp, ops); if (ret) goto err_put_pid; --=20 2.52.0 From nobody Fri Dec 19 11:45:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9B532EFD9E for ; Sun, 7 Dec 2025 12:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111237; cv=none; b=Ff7fTZlQdkqAEsecfSphTkGQu9Vpgsha8FDHQwwgqgjVZoy0s1acb7cCXpprOloiC21SpwQrWKnNoXhQZVR1FvG51/W5U74IbR9OPx44Ve4XyYlDpVOe25PlT5iByHgaUlyCS1yJrO5sSaXe12hjcR7wU6MED5hgR3DSlL5JmGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765111237; c=relaxed/simple; bh=K2R9b0barWC68k/7xbhNUGCfm1zFHkjY7UaNg/NdOEg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=YN2AqMKJgd4/95AWcEUPnNapGRTAzEvRc17TnjwN9BDCB+1HRkFp7BKWr1l/tS9JnVcvkqzG+1hIEqB7U8fGbXYmC7ilv8j3uh4epYlN3Xn69XhaEe3FSA+BY0kiIY0ioSMBuNIpnqqmaB+kxWrXHss4KWlcg0+pdVzahu22K2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bx9MV3qx; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bx9MV3qx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765111234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=vBKRDP8bqkordujGp7qy48QcPV4IJTrct7fsioyRbjk=; b=bx9MV3qx3KsP2Idzhf0kp4SUIz9JmLxogjwrubbn7H5USuxYVbj4C/QUnLKOekTvR/07Ch gY9edY2OFB0xHMrkIq6J7OQRVgMTWLDCBHQXv2kcmMqMVHNkx4ONJugct9TJLeN2seHREy zlMCf245sbSeUUc8DoIzwJ334fnaKTE= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-JQrVjfGoPfWfFYZ-A2FkAA-1; Sun, 07 Dec 2025 07:40:30 -0500 X-MC-Unique: JQrVjfGoPfWfFYZ-A2FkAA-1 X-Mimecast-MFC-AGG-ID: JQrVjfGoPfWfFYZ-A2FkAA_1765111226 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C312A195609F; Sun, 7 Dec 2025 12:40:26 +0000 (UTC) Received: from fedora (unknown [10.44.32.50]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id B38033011A86; Sun, 7 Dec 2025 12:40:16 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 7 Dec 2025 13:40:28 +0100 (CET) Date: Sun, 7 Dec 2025 13:40:17 +0100 From: Oleg Nesterov To: Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , David Airlie , Simona Vetter , Boris Brezillon , Rob Herring , Steven Price , =?iso-8859-1?Q?Adri=E1n?= Larumbe , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Liviu Dudau , Jason Gunthorpe , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 7/7] netclassid: use thread_group_leader(p) in update_classid_task() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. Signed-off-by: Oleg Nesterov --- 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, u3= 2 classid) /* Only update the leader task, when many threads in this task, * so it can avoid the useless traversal. */ - if (p !=3D p->group_leader) + if (!thread_group_leader(p)) return; =20 do { --=20 2.52.0