dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] File owner follows use
@ 2022-11-30 13:34 Tvrtko Ursulin
  2022-11-30 13:34 ` [RFC 1/3] drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling Tvrtko Ursulin
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2022-11-30 13:34 UTC (permalink / raw)
  To: dri-devel; +Cc: Christian König, Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Not so long ago when I sent out my DRM cgroup controller RFC I had some pieces
in it which were tracking the real client using a specific drm_file. Christian
then suggested that should probably be extracted and improved in the DRM core
from the start, which was on his wishlist for a long period. So this mini-series
is an attempt at that.

First patch is just a logging cleanup, 2nd probably makes sense on it's own
since it replaces tracking thread names with progresses which are more
meaningful. Third one is where action is.

The benefit on it's own is rather small, especially relative to the complication
to track it, where it essentially changes the debugfs clients output from:

             command   pid dev master a   uid      magic
                Xorg  1744   0   y    y     0          0
                Xorg  1744   0   n    y     0          1
                Xorg  1744   0   n    y     0          2
                Xorg  1744   0   n    y     0          3

To something like:

             command  tgid dev master a   uid      magic
                Xorg   830   0   y    y     0          0
       xfce4-session   880   0   n    y     0          1
               xfwm4   943   0   n    y     0          2
           neverball  1095   0   n    y     0          3

One ugly part is one synchronise_rcu() on the first (hopefully) only fd
handover. The latency of that could be improved by further wrapping and
kfree_rcu() if desired.

Another part I am unsure of is whether master nodes are ever handed over via
sockets. I assumed no and exluded them from ownership updates. If they need to
be then drm_master_check_perm() would break, I think. So looking for some
feedback in this area please.

Tvrtko Ursulin (3):
  drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling
  drm: Track clients by tgid and not tid
  drm: Update file owner during use

 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c |  6 ++-
 drivers/gpu/drm/drm_auth.c              |  3 +-
 drivers/gpu/drm/drm_debugfs.c           | 12 +++---
 drivers/gpu/drm/drm_file.c              | 53 ++++++++++++++++++++-----
 drivers/gpu/drm/drm_ioc32.c             | 13 +++---
 drivers/gpu/drm/drm_ioctl.c             | 28 +++++++------
 drivers/gpu/drm/nouveau/nouveau_drm.c   |  5 ++-
 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c     |  6 ++-
 include/drm/drm_file.h                  | 13 +++++-
 9 files changed, 97 insertions(+), 42 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-01-12 18:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 13:34 [RFC 0/3] File owner follows use Tvrtko Ursulin
2022-11-30 13:34 ` [RFC 1/3] drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling Tvrtko Ursulin
2022-12-02  8:38   ` Christian König
2022-11-30 13:34 ` [RFC 2/3] drm: Track clients by tgid and not tid Tvrtko Ursulin
2022-11-30 13:34 ` [RFC 3/3] drm: Update file owner during use Tvrtko Ursulin
2022-11-30 14:18   ` Daniel Vetter
2022-12-01 11:09     ` Tvrtko Ursulin
2022-12-02  9:01       ` Christian König
2023-01-05 12:32         ` Daniel Vetter
2023-01-06 10:32           ` Christian König
2023-01-06 10:53             ` Daniel Vetter
2023-01-06 14:53               ` Christian König
2023-01-06 18:00                 ` Daniel Vetter
2023-01-10 13:14                   ` Tvrtko Ursulin
2023-01-11 22:19                     ` Daniel Vetter
2023-01-12 18:49                       ` Tvrtko Ursulin
2023-01-06 13:18           ` Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).