diff options
| author | Zack Rusin <zackr@vmware.com> | 2022-12-07 12:29:07 -0500 |
|---|---|---|
| committer | Zack Rusin <zackr@vmware.com> | 2023-01-09 21:15:36 -0500 |
| commit | a309c7194e8a2f8bd4539b9449917913f6c2cd50 (patch) | |
| tree | 2774c49f4f5f962fd9271533104b293bd1031aad /drivers/gpu/drm/vmwgfx/ttm_object.h | |
| parent | 52531258318ed59a2dc5a43df2eaf0eb1d65438e (diff) | |
| download | linux-next-a309c7194e8a2f8bd4539b9449917913f6c2cd50.tar.gz linux-next-a309c7194e8a2f8bd4539b9449917913f6c2cd50.zip | |
drm/vmwgfx: Remove rcu locks from user resources
User resource lookups used rcu to avoid two extra atomics. Unfortunately
the rcu paths were buggy and it was easy to make the driver crash by
submitting command buffers from two different threads. Because the
lookups never show up in performance profiles replace them with a
regular spin lock which fixes the races in accesses to those shared
resources.
Fixes kernel oops'es in IGT's vmwgfx execution_buffer stress test and
seen crashes with apps using shared resources.
Fixes: e14c02e6b699 ("drm/vmwgfx: Look up objects without taking a reference")
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221207172907.959037-1-zack@kde.org
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/ttm_object.h')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/ttm_object.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/gpu/drm/vmwgfx/ttm_object.h b/drivers/gpu/drm/vmwgfx/ttm_object.h index f0ebbe340ad6..8098a3846bae 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.h +++ b/drivers/gpu/drm/vmwgfx/ttm_object.h @@ -307,18 +307,4 @@ extern int ttm_prime_handle_to_fd(struct ttm_object_file *tfile, #define ttm_prime_object_kfree(__obj, __prime) \ kfree_rcu(__obj, __prime.base.rhead) -struct ttm_base_object * -ttm_base_object_noref_lookup(struct ttm_object_file *tfile, uint64_t key); - -/** - * ttm_base_object_noref_release - release a base object pointer looked up - * without reference - * - * Releases a base object pointer looked up with ttm_base_object_noref_lookup(). - */ -static inline void ttm_base_object_noref_release(void) -{ - __acquire(RCU); - rcu_read_unlock(); -} #endif |
