[openib-general] Re: [PATCH] process locked in D state.

Michael S. Tsirkin mst at mellanox.co.il
Tue Jun 28 14:30:18 PDT 2005


Quoting r. Roland Dreier <rolandd at cisco.com>:
> OK, this looks fine.  Applied (with slight renames of function names).
> 
> Thanks,
>   Roland
> 

Now that ib_umem_release is always called in the context of a system
call, we dont have to get_task_mm, since current->mm is not going anywere.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: infiniband/core/uverbs_mem.c
===================================================================
--- infiniband/core/uverbs_mem.c	(revision 2740)
+++ infiniband/core/uverbs_mem.c	(working copy)
@@ -174,14 +174,10 @@ void ib_umem_release(struct ib_device *d
 
 	__ib_umem_release(dev, umem, 1);
 
-	mm = get_task_mm(current);
-	if (!mm)
-		return;
-
+	mm = current->mm;
 	down_write(&mm->mmap_sem);
 	mm->locked_vm -= PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;
 	up_write(&mm->mmap_sem);
-	mmput(mm);
 }
 
 static void ib_umem_account(void *work_ptr)
-- 
MST



More information about the general mailing list