kernel-ark/drivers/infiniband/core
Roland Dreier 1bf66a3042 IB: Put rlimit accounting struct in struct ib_umem
When memory pinned with ib_umem_get() is released, ib_umem_release()
needs to subtract the amount of memory being unpinned from
mm->locked_vm.  However, ib_umem_release() may be called with
mm->mmap_sem already held for writing if the memory is being released
as part of an munmap() call, so it is sometimes necessary to defer
this accounting into a workqueue.

However, the work struct used to defer this accounting is dynamically
allocated before it is queued, so there is the possibility of failing
that allocation.  If the allocation fails, then ib_umem_release has no
choice except to bail out and leave the process with a permanently
elevated locked_vm.

Fix this by allocating the structure to defer accounting as part of
the original struct ib_umem, so there's no possibility of failing a
later allocation if creating the struct ib_umem and pinning memory
succeeds.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-05-08 18:00:37 -07:00
..
addr.c IB: Remove redundant "_wq" from workqueue names 2007-02-10 08:00:50 -08:00
agent.c
agent.h
cache.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
cm_msgs.h
cm.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
cma.c RDMA/cma: Initialize rdma_bind_list in cma_alloc_any_port() 2007-03-06 12:41:44 -08:00
core_priv.h
device.c IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
fmr_pool.c IB/fmr_pool: Add prefix to all printks 2007-05-06 21:18:11 -07:00
iwcm.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
iwcm.h
mad_priv.h PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
mad_rmpp.c
mad_rmpp.h
mad.c IB: Add CQ comp_vector support 2007-05-06 21:18:11 -07:00
Makefile IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
multicast.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
packer.c
sa_query.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
sa.h IB/sa: Track multicast join/leave requests 2007-02-16 14:20:02 -08:00
smi.c IB/mad: Change SMI to use enums rather than magic return codes 2007-04-24 16:31:12 -07:00
smi.h IB/mad: Change SMI to use enums rather than magic return codes 2007-04-24 16:31:12 -07:00
sysfs.c IB: Set class_dev->dev in core for nice device symlink 2007-04-24 21:30:38 -07:00
ucm.c IB/ucm: Simplify ib_ucm_event() 2007-04-24 16:31:11 -07:00
ucma.c RDMA/ucma: Simplify ucma_get_event() 2007-04-24 16:31:11 -07:00
ud_header.c
umem.c IB: Put rlimit accounting struct in struct ib_umem 2007-05-08 18:00:37 -07:00
user_mad.c PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
uverbs_cmd.c IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
uverbs_main.c IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
uverbs_marshall.c RDMA/cma: Export rdma cm interface to userspace 2006-12-12 11:50:22 -08:00
uverbs.h IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
verbs.c IB: Add CQ comp_vector support 2007-05-06 21:18:11 -07:00