mbox series

[0/2] locking/rwsem: Add down_write_interruptible and use it

Message ID 20210308205456.1317366-1-zackr@vmware.com (mailing list archive)
Headers show
Series locking/rwsem: Add down_write_interruptible and use it | expand

Message

Zack Rusin March 8, 2021, 8:54 p.m. UTC
vmwgfx has really ugly implemention of an interruptible lock trying
to match rw sem semantics. By adding a small bit of code implementing
down_write_interruptible to rwsem which already supported
down_read_interruptible we can completely remove all of the custom
code from vmwgfx.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Martin Krastev <krastevm@vmware.com>
Cc: Roland Scheidegger <sroland@vmware.com>
Cc: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org

Zack Rusin (2):
  locking/rwsem: Add down_write_interruptible
  drm/vmwgfx: Remove custom locking code

 drivers/gpu/drm/vmwgfx/Makefile               |   2 +-
 drivers/gpu/drm/vmwgfx/ttm_lock.c             | 194 ----------------
 drivers/gpu/drm/vmwgfx/ttm_lock.h             | 218 ------------------
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c            |  24 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_context.c       |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c           |  57 +----
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h           |  32 ++-
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c       |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c            |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c         |   8 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c      |   8 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_shader.c        |   4 +-
 .../gpu/drm/vmwgfx/vmwgfx_simple_resource.c   |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c       |  16 +-
 include/linux/rwsem.h                         |   1 +
 kernel/locking/rwsem.c                        |  23 ++
 17 files changed, 98 insertions(+), 515 deletions(-)
 delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_lock.c
 delete mode 100644 drivers/gpu/drm/vmwgfx/ttm_lock.h