dma-resv: lockdep-prime address_space->i_mmap_rwsem for dma-resv
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Jul 2020 13:58:39 +0000 (15:58 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 17 Sep 2020 13:17:56 +0000 (15:17 +0200)
commit7dd1b884f777beee4c0f3471a327697005118db8
treee7ac31d054f06d92d8d70cbdc4c7b51ced0388cb
parente5e1065f922380ced35e6b6ec3c58c28f57b74fd
dma-resv: lockdep-prime address_space->i_mmap_rwsem for dma-resv

GPU drivers need this in their shrinkers, to be able to throw out
mmap'ed buffers. Note that we also need dma_resv_lock in shrinkers,
but that loop is resolved by trylocking in shrinkers.

So full hierarchy is now (ignore some of the other branches we already
have primed):

mmap_read_lock -> dma_resv -> shrinkers -> i_mmap_lock_write

I hope that's not inconsistent with anything mm or fs does, adding
relevant people.

Reviewed-by: Thomas Hellström <thomas.hellstrom@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Cc: Dave Chinner <david@fromorbit.com>
Cc: Qian Cai <cai@lca.pw>
Cc: linux-xfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: Thomas Hellström (Intel) <thomas_os@shipmail.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: linux-mm@kvack.org
Cc: linux-rdma@vger.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728135839.1035515-1-daniel.vetter@ffwll.ch
drivers/dma-buf/dma-resv.c