]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Some kernel components pin user space memory (infiniband and perf) (by
authorChristoph Lameter <cl@linux.com>
Wed, 24 Aug 2011 23:46:54 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 26 Aug 2011 04:05:59 +0000 (14:05 +1000)
commitcef2815f1ce6127e664e639800f5715f325ba754
tree3e4d9cdf3cc13be7ae1b571ed1f2a5a86651b332
parent3aa095d6cee92e068e8606f9f3087c3fffc1ae5c
Some kernel components pin user space memory (infiniband and perf) (by
increasing the page count) and account that memory as "mlocked".

The difference between mlocking and pinning is:

A. mlocked pages are marked with PG_mlocked and are exempt from
   swapping. Page migration may move them around though.
   They are kept on a special LRU list.

B. Pinned pages cannot be moved because something needs to
   directly access physical memory. They may not be on any
   LRU list.

I recently saw an mlockalled process where mm->locked_vm became
bigger than the virtual size of the process (!) because some
memory was accounted for twice:

Once when the page was mlocked and once when the Infiniband
layer increased the refcount because it needt to pin the RDMA
memory.

This patch introduces a separate counter for pinned pages and
accounts them seperately.

Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Mike Marciniszyn <infinipath@qlogic.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/infiniband/core/umem.c
drivers/infiniband/hw/ipath/ipath_user_pages.c
drivers/infiniband/hw/qib/qib_user_pages.c
fs/proc/task_mmu.c
include/linux/mm_types.h
kernel/events/core.c