Message ID | 20230314141904.1210824-2-tvrtko.ursulin@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1791554wrd; Tue, 14 Mar 2023 07:29:16 -0700 (PDT) X-Google-Smtp-Source: AK7set8ScO4xIotYJeDTtlblobVZZAbZV1U/Hzqs32042CM3YJQ0OANfdLKp/UPvaeuUN1Nzc5zl X-Received: by 2002:a17:902:efc5:b0:19f:3d75:581e with SMTP id ja5-20020a170902efc500b0019f3d75581emr7808426plb.46.1678804156080; Tue, 14 Mar 2023 07:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678804156; cv=none; d=google.com; s=arc-20160816; b=07oA5FW0jf95MC13ZvSgvQz3zsV7m8aox082hgwdyqz01h157XoANcCnbXscSGK5io 4ujWNkd4Q1fPFjxjNr5w0OJIAGjbMu0o9cpltqTxBIP603jnVXaYQl7AEND4f8ChX3pY 32Icn+kXsuHZlRG/In0gXGxx2ljK5PUcvtVxnupdrOcjlHQcnOCDh02YLdfZfttNGhC9 dyWEPOU4uAqktxI2mRkEkvWudQFHG+dW3xIqXWFm7HRSMvocdXUKzkvX69umJktZCljx kVois/NpmkimIFPLCNoBjjrBZhqzntbCV9ueMeV7w9YPtCIY4E13NzXqz9ttbbtEJg5O rktw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cFXyHRoVkaMTRWr3t91GBt5jcMHkU7fg/Q6ahsKm19g=; b=Ywewgtvg5ep5ZPqk2XeJXOAImUzUYeM0eGLdBMGXMzKBHaHERsNo5F3yZtuuf7NqoQ cPhrcC0TDCfqevzVsukPC2C5O5riVL6njuROycynP0MVwlpcszcinSJbZlo3CQPdWaEc hBO89eJl7Um3S2g/nRz/hXEeD54sYJEUKKFQ4e2CLUX5wpugCjNwO2WKwkYjBFZsW5Gx GTQcQTaF6HtEsiWPl5UrumX+WwvnLlFDtU97j10FoC+jzW0Y62W5dJggCKs1HnGI2yI+ 33jV2oQaluq/wAkhmWflF6osgErfqPOURooz6oJDfqokdzLhRhifzq+XEExlhXmxq7D5 FdZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jFij9oum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk13-20020a17090308cd00b0019e37273a1bsi1530662plb.402.2023.03.14.07.29.02; Tue, 14 Mar 2023 07:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jFij9oum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbjCNOTn (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Tue, 14 Mar 2023 10:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjCNOTb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Mar 2023 10:19:31 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13F022DC7; Tue, 14 Mar 2023 07:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678803562; x=1710339562; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jDLp2/3Yl14dmLvreY8sfPyvQKizzKWroDIsTYa9bwY=; b=jFij9oumtXklZlImqaBqqiCEja5l8Fu07CW54NTNZ9yX/4FcHO3ysF1d ve+U/BvkfR0czm6/9CDduSG3FH68eFMinjREjCB0D1AbxWsddnFXBD4ys M6qiwBpr6wqajqJBVA1XCyOxv3jgfiC/y7A5t81oYHHRUw+u5622spcpk VIAsfSy1sl6Ly8eD5IA89n7H+RdAyGHLWw9hTsWn5UoVpBCUvGn9iMlSv RvQCfQJtfg+0Gnjb9eg8z1PopdafZ1r+tR0BW6bmZnR8jzo5FZ1c19nnD fj78gCdnPpFB4mKvzMpRCW0mifHjXg8Sfu2D5oGzqj/QPHZ5Vxxl7SocP g==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="321284650" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="321284650" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 07:19:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="656363203" X-IronPort-AV: E=Sophos;i="5.98,260,1673942400"; d="scan'208";a="656363203" Received: from mjtillin-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.236.227]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 07:19:16 -0700 From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, Zefan Li <lizefan.x@bytedance.com>, Dave Airlie <airlied@redhat.com>, Daniel Vetter <daniel.vetter@ffwll.ch>, Rob Clark <robdclark@chromium.org>, =?utf-8?q?St=C3=A9phane_Marchesin?= <marcheu@chromium.org>, "T . J . Mercier" <tjmercier@google.com>, Kenny.Ho@amd.com, =?utf-8?q?Chris?= =?utf-8?q?tian_K=C3=B6nig?= <christian.koenig@amd.com>, Brian Welty <brian.welty@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@intel.com>, Zack Rusin <zackr@vmware.com>, linux-graphics-maintainer@vmware.com, Alex Deucher <alexander.deucher@amd.com> Subject: [RFC 01/10] drm: Track clients by tgid and not tid Date: Tue, 14 Mar 2023 14:18:55 +0000 Message-Id: <20230314141904.1210824-2-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230314141904.1210824-1-tvrtko.ursulin@linux.intel.com> References: <20230314141904.1210824-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HK_RANDOM_ENVFROM,HK_RANDOM_FROM, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760353747033586688?= X-GMAIL-MSGID: =?utf-8?q?1760353747033586688?= |
Series |
DRM scheduling cgroup controller
|
|
Commit Message
Tvrtko Ursulin
March 14, 2023, 2:18 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Thread group id (aka pid from userspace point of view) is a more interesting thing to show as an owner of a DRM fd, so track and show that instead of the thread id. In the next patch we will make the owner updated post file descriptor handover, which will also be tgid based to avoid ping-pong when multiple threads access the fd. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Zack Rusin <zackr@vmware.com> Cc: linux-graphics-maintainer@vmware.com Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Reviewed-by: Zack Rusin <zackr@vmware.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 4 ++-- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
Comments
Am 14.03.23 um 15:18 schrieb Tvrtko Ursulin: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > Thread group id (aka pid from userspace point of view) is a more > interesting thing to show as an owner of a DRM fd, so track and show that > instead of the thread id. > > In the next patch we will make the owner updated post file descriptor > handover, which will also be tgid based to avoid ping-pong when multiple > threads access the fd. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Cc: Zack Rusin <zackr@vmware.com> > Cc: linux-graphics-maintainer@vmware.com > Cc: Alex Deucher <alexander.deucher@amd.com> > Cc: "Christian König" <christian.koenig@amd.com> > Reviewed-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Christian König <christian.koenig@amd.com> Should we push the already reviewed cleanups like this one to drm-misc-next? That makes sense even without the rest of the functionality and reduce the amount of patches re-send. Christian. > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- > drivers/gpu/drm/drm_debugfs.c | 4 ++-- > drivers/gpu/drm/drm_file.c | 2 +- > drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > index d8e683688daa..863cb668e000 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > @@ -969,7 +969,7 @@ static int amdgpu_debugfs_gem_info_show(struct seq_file *m, void *unused) > * Therefore, we need to protect this ->comm access using RCU. > */ > rcu_read_lock(); > - task = pid_task(file->pid, PIDTYPE_PID); > + task = pid_task(file->pid, PIDTYPE_TGID); > seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), > task ? task->comm : "<unknown>"); > rcu_read_unlock(); > diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c > index 4f643a490dc3..4855230ba2c6 100644 > --- a/drivers/gpu/drm/drm_debugfs.c > +++ b/drivers/gpu/drm/drm_debugfs.c > @@ -80,7 +80,7 @@ static int drm_clients_info(struct seq_file *m, void *data) > seq_printf(m, > "%20s %5s %3s master a %5s %10s\n", > "command", > - "pid", > + "tgid", > "dev", > "uid", > "magic"); > @@ -94,7 +94,7 @@ static int drm_clients_info(struct seq_file *m, void *data) > bool is_current_master = drm_is_current_master(priv); > > rcu_read_lock(); /* locks pid_task()->comm */ > - task = pid_task(priv->pid, PIDTYPE_PID); > + task = pid_task(priv->pid, PIDTYPE_TGID); > uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; > seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n", > task ? task->comm : "<unknown>", > diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c > index a51ff8cee049..c1018c470047 100644 > --- a/drivers/gpu/drm/drm_file.c > +++ b/drivers/gpu/drm/drm_file.c > @@ -156,7 +156,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) > if (!file) > return ERR_PTR(-ENOMEM); > > - file->pid = get_pid(task_pid(current)); > + file->pid = get_pid(task_tgid(current)); > file->minor = minor; > > /* for compatibility root is always authenticated */ > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > index d6baf73a6458..c0da89e16e6f 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c > @@ -241,7 +241,7 @@ static int vmw_debugfs_gem_info_show(struct seq_file *m, void *unused) > * Therefore, we need to protect this ->comm access using RCU. > */ > rcu_read_lock(); > - task = pid_task(file->pid, PIDTYPE_PID); > + task = pid_task(file->pid, PIDTYPE_TGID); > seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), > task ? task->comm : "<unknown>"); > rcu_read_unlock();
Hi, On 14/03/2023 15:33, Christian König wrote: > Am 14.03.23 um 15:18 schrieb Tvrtko Ursulin: >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> >> Thread group id (aka pid from userspace point of view) is a more >> interesting thing to show as an owner of a DRM fd, so track and show that >> instead of the thread id. >> >> In the next patch we will make the owner updated post file descriptor >> handover, which will also be tgid based to avoid ping-pong when multiple >> threads access the fd. >> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> Cc: Zack Rusin <zackr@vmware.com> >> Cc: linux-graphics-maintainer@vmware.com >> Cc: Alex Deucher <alexander.deucher@amd.com> >> Cc: "Christian König" <christian.koenig@amd.com> >> Reviewed-by: Zack Rusin <zackr@vmware.com> > > Reviewed-by: Christian König <christian.koenig@amd.com> > > Should we push the already reviewed cleanups like this one to > drm-misc-next? That makes sense even without the rest of the > functionality and reduce the amount of patches re-send. I don't have the commit rights so if you could do that I certainly would not mind, thanks! Regards, Tvrtko >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- >> drivers/gpu/drm/drm_debugfs.c | 4 ++-- >> drivers/gpu/drm/drm_file.c | 2 +- >> drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 2 +- >> 4 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >> index d8e683688daa..863cb668e000 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >> @@ -969,7 +969,7 @@ static int amdgpu_debugfs_gem_info_show(struct >> seq_file *m, void *unused) >> * Therefore, we need to protect this ->comm access using RCU. >> */ >> rcu_read_lock(); >> - task = pid_task(file->pid, PIDTYPE_PID); >> + task = pid_task(file->pid, PIDTYPE_TGID); >> seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), >> task ? task->comm : "<unknown>"); >> rcu_read_unlock(); >> diff --git a/drivers/gpu/drm/drm_debugfs.c >> b/drivers/gpu/drm/drm_debugfs.c >> index 4f643a490dc3..4855230ba2c6 100644 >> --- a/drivers/gpu/drm/drm_debugfs.c >> +++ b/drivers/gpu/drm/drm_debugfs.c >> @@ -80,7 +80,7 @@ static int drm_clients_info(struct seq_file *m, void >> *data) >> seq_printf(m, >> "%20s %5s %3s master a %5s %10s\n", >> "command", >> - "pid", >> + "tgid", >> "dev", >> "uid", >> "magic"); >> @@ -94,7 +94,7 @@ static int drm_clients_info(struct seq_file *m, void >> *data) >> bool is_current_master = drm_is_current_master(priv); >> rcu_read_lock(); /* locks pid_task()->comm */ >> - task = pid_task(priv->pid, PIDTYPE_PID); >> + task = pid_task(priv->pid, PIDTYPE_TGID); >> uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; >> seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n", >> task ? task->comm : "<unknown>", >> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c >> index a51ff8cee049..c1018c470047 100644 >> --- a/drivers/gpu/drm/drm_file.c >> +++ b/drivers/gpu/drm/drm_file.c >> @@ -156,7 +156,7 @@ struct drm_file *drm_file_alloc(struct drm_minor >> *minor) >> if (!file) >> return ERR_PTR(-ENOMEM); >> - file->pid = get_pid(task_pid(current)); >> + file->pid = get_pid(task_tgid(current)); >> file->minor = minor; >> /* for compatibility root is always authenticated */ >> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >> b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >> index d6baf73a6458..c0da89e16e6f 100644 >> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >> @@ -241,7 +241,7 @@ static int vmw_debugfs_gem_info_show(struct >> seq_file *m, void *unused) >> * Therefore, we need to protect this ->comm access using RCU. >> */ >> rcu_read_lock(); >> - task = pid_task(file->pid, PIDTYPE_PID); >> + task = pid_task(file->pid, PIDTYPE_TGID); >> seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), >> task ? task->comm : "<unknown>"); >> rcu_read_unlock(); >
Am 15.03.23 um 10:52 schrieb Tvrtko Ursulin: > > Hi, > > On 14/03/2023 15:33, Christian König wrote: >> Am 14.03.23 um 15:18 schrieb Tvrtko Ursulin: >>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>> >>> Thread group id (aka pid from userspace point of view) is a more >>> interesting thing to show as an owner of a DRM fd, so track and show >>> that >>> instead of the thread id. >>> >>> In the next patch we will make the owner updated post file descriptor >>> handover, which will also be tgid based to avoid ping-pong when >>> multiple >>> threads access the fd. >>> >>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>> Cc: Zack Rusin <zackr@vmware.com> >>> Cc: linux-graphics-maintainer@vmware.com >>> Cc: Alex Deucher <alexander.deucher@amd.com> >>> Cc: "Christian König" <christian.koenig@amd.com> >>> Reviewed-by: Zack Rusin <zackr@vmware.com> >> >> Reviewed-by: Christian König <christian.koenig@amd.com> >> >> Should we push the already reviewed cleanups like this one to >> drm-misc-next? That makes sense even without the rest of the >> functionality and reduce the amount of patches re-send. > > I don't have the commit rights so if you could do that I certainly > would not mind, thanks! I've just pushed this patch here to drm-misc-next. As soon as Daniel or Dave gives his ok as well I'm going to also push the second one. Regards, Christian. > > Regards, > > Tvrtko > >>> --- >>> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- >>> drivers/gpu/drm/drm_debugfs.c | 4 ++-- >>> drivers/gpu/drm/drm_file.c | 2 +- >>> drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 2 +- >>> 4 files changed, 5 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >>> index d8e683688daa..863cb668e000 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c >>> @@ -969,7 +969,7 @@ static int amdgpu_debugfs_gem_info_show(struct >>> seq_file *m, void *unused) >>> * Therefore, we need to protect this ->comm access using >>> RCU. >>> */ >>> rcu_read_lock(); >>> - task = pid_task(file->pid, PIDTYPE_PID); >>> + task = pid_task(file->pid, PIDTYPE_TGID); >>> seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), >>> task ? task->comm : "<unknown>"); >>> rcu_read_unlock(); >>> diff --git a/drivers/gpu/drm/drm_debugfs.c >>> b/drivers/gpu/drm/drm_debugfs.c >>> index 4f643a490dc3..4855230ba2c6 100644 >>> --- a/drivers/gpu/drm/drm_debugfs.c >>> +++ b/drivers/gpu/drm/drm_debugfs.c >>> @@ -80,7 +80,7 @@ static int drm_clients_info(struct seq_file *m, >>> void *data) >>> seq_printf(m, >>> "%20s %5s %3s master a %5s %10s\n", >>> "command", >>> - "pid", >>> + "tgid", >>> "dev", >>> "uid", >>> "magic"); >>> @@ -94,7 +94,7 @@ static int drm_clients_info(struct seq_file *m, >>> void *data) >>> bool is_current_master = drm_is_current_master(priv); >>> rcu_read_lock(); /* locks pid_task()->comm */ >>> - task = pid_task(priv->pid, PIDTYPE_PID); >>> + task = pid_task(priv->pid, PIDTYPE_TGID); >>> uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; >>> seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n", >>> task ? task->comm : "<unknown>", >>> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c >>> index a51ff8cee049..c1018c470047 100644 >>> --- a/drivers/gpu/drm/drm_file.c >>> +++ b/drivers/gpu/drm/drm_file.c >>> @@ -156,7 +156,7 @@ struct drm_file *drm_file_alloc(struct drm_minor >>> *minor) >>> if (!file) >>> return ERR_PTR(-ENOMEM); >>> - file->pid = get_pid(task_pid(current)); >>> + file->pid = get_pid(task_tgid(current)); >>> file->minor = minor; >>> /* for compatibility root is always authenticated */ >>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >>> b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >>> index d6baf73a6458..c0da89e16e6f 100644 >>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c >>> @@ -241,7 +241,7 @@ static int vmw_debugfs_gem_info_show(struct >>> seq_file *m, void *unused) >>> * Therefore, we need to protect this ->comm access using >>> RCU. >>> */ >>> rcu_read_lock(); >>> - task = pid_task(file->pid, PIDTYPE_PID); >>> + task = pid_task(file->pid, PIDTYPE_TGID); >>> seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), >>> task ? task->comm : "<unknown>"); >>> rcu_read_unlock(); >>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index d8e683688daa..863cb668e000 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -969,7 +969,7 @@ static int amdgpu_debugfs_gem_info_show(struct seq_file *m, void *unused) * Therefore, we need to protect this ->comm access using RCU. */ rcu_read_lock(); - task = pid_task(file->pid, PIDTYPE_PID); + task = pid_task(file->pid, PIDTYPE_TGID); seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), task ? task->comm : "<unknown>"); rcu_read_unlock(); diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 4f643a490dc3..4855230ba2c6 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -80,7 +80,7 @@ static int drm_clients_info(struct seq_file *m, void *data) seq_printf(m, "%20s %5s %3s master a %5s %10s\n", "command", - "pid", + "tgid", "dev", "uid", "magic"); @@ -94,7 +94,7 @@ static int drm_clients_info(struct seq_file *m, void *data) bool is_current_master = drm_is_current_master(priv); rcu_read_lock(); /* locks pid_task()->comm */ - task = pid_task(priv->pid, PIDTYPE_PID); + task = pid_task(priv->pid, PIDTYPE_TGID); uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n", task ? task->comm : "<unknown>", diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index a51ff8cee049..c1018c470047 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -156,7 +156,7 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) if (!file) return ERR_PTR(-ENOMEM); - file->pid = get_pid(task_pid(current)); + file->pid = get_pid(task_tgid(current)); file->minor = minor; /* for compatibility root is always authenticated */ diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c index d6baf73a6458..c0da89e16e6f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c @@ -241,7 +241,7 @@ static int vmw_debugfs_gem_info_show(struct seq_file *m, void *unused) * Therefore, we need to protect this ->comm access using RCU. */ rcu_read_lock(); - task = pid_task(file->pid, PIDTYPE_PID); + task = pid_task(file->pid, PIDTYPE_TGID); seq_printf(m, "pid %8d command %s:\n", pid_nr(file->pid), task ? task->comm : "<unknown>"); rcu_read_unlock();