summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-05-23 10:36:46 -0300
committerJason Gunthorpe <jgg@mellanox.com>2019-06-10 10:10:33 -0300
commitc8a53b2db0aec40d8b217936e1b7f3d840c50390 (patch)
treeea375fb462731dce8200eef3b650cd9acab2f1dd /kernel
parente36acfe6c86d13eec62321e1e86a1ce287e52e7d (diff)
downloadblackbird-op-linux-c8a53b2db0aec40d8b217936e1b7f3d840c50390.tar.gz
blackbird-op-linux-c8a53b2db0aec40d8b217936e1b7f3d840c50390.zip
mm/hmm: Hold a mmgrab from hmm to mm
So long as a struct hmm pointer exists, so should the struct mm it is linked too. Hold the mmgrab() as soon as a hmm is created, and mmdrop() it once the hmm refcount goes to zero. Since mmdrop() (ie a 0 kref on struct mm) is now impossible with a !NULL mm->hmm delete the hmm_hmm_destroy(). Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Ralph Campbell <rcampbell@nvidia.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Philip Yang <Philip.Yang@amd.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 75675b9bf6df..c704c3cedee7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -673,7 +673,6 @@ void __mmdrop(struct mm_struct *mm)
WARN_ON_ONCE(mm == current->active_mm);
mm_free_pgd(mm);
destroy_context(mm);
- hmm_mm_destroy(mm);
mmu_notifier_mm_destroy(mm);
check_mm(mm);
put_user_ns(mm->user_ns);
OpenPOWER on IntegriCloud