summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDean Luick <dean.luick@intel.com>2016-07-28 21:21:24 +0200
committerDoug Ledford <dledford@redhat.com>2016-08-03 04:46:21 +0200
commitb85ced91511f6c3add9a74ae13e12ba568bfa1af (patch)
tree89d9b322fe8eb281242f8f3af740d485d5dc446e /usr
parentIB/hfi1: Use evict mmu rb operation (diff)
downloadlinux-b85ced91511f6c3add9a74ae13e12ba568bfa1af.tar.xz
linux-b85ced91511f6c3add9a74ae13e12ba568bfa1af.zip
IB/hfi1: Consistently call ops->remove outside spinlock
The ops->remove() callback was called by hfi1_mmu_unregister() with a NULL mm argument while holding a spinlock. In the case of sdma_rb_remove() this caused it to pass current->mm to hfi1_release_user_pages() This had 2 problems. First this would attempt to acquire the mmap_sem under a spin lock. Second the use of current->mm is not always guaranteed to be the proper mm when the fd is being closed. Rather than depend on this implicit behavior we move all calls to ops->remove outside of the spinlock. This also allows the correct mm to be used in the remove callback without fear of deadlock. Because the MMU notifier is not guaranteed to hold mm->mmap_sem, but usually does, we must delay all remove callbacks until out of the notifier, when the callbacks can take the mmap_sem if they need to. Code comments were added to clarify what the expectations are for the users of the mmu rb tree. Suggested-by: Jim Foraker <foraker1@llnl.gov> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions