Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272122
b: refs/heads/master
c: bc3e53f
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Nov 1, 2011
1 parent 56bc1be commit 63b4158
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f11c0ca501af89fc07b0d9f17531ba3b68a4ef39
refs/heads/master: bc3e53f682d93df677dbd5006a404722b3adfe18
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/core/umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,

down_write(&current->mm->mmap_sem);

locked = npages + current->mm->locked_vm;
locked = npages + current->mm->pinned_vm;
lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;

if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) {
Expand Down Expand Up @@ -206,7 +206,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
__ib_umem_release(context->device, umem, 0);
kfree(umem);
} else
current->mm->locked_vm = locked;
current->mm->pinned_vm = locked;

up_write(&current->mm->mmap_sem);
if (vma_list)
Expand All @@ -222,7 +222,7 @@ static void ib_umem_account(struct work_struct *work)
struct ib_umem *umem = container_of(work, struct ib_umem, work);

down_write(&umem->mm->mmap_sem);
umem->mm->locked_vm -= umem->diff;
umem->mm->pinned_vm -= umem->diff;
up_write(&umem->mm->mmap_sem);
mmput(umem->mm);
kfree(umem);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/hw/ipath/ipath_user_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages,
goto bail_release;
}

current->mm->locked_vm += num_pages;
current->mm->pinned_vm += num_pages;

ret = 0;
goto bail;
Expand Down Expand Up @@ -178,7 +178,7 @@ void ipath_release_user_pages(struct page **p, size_t num_pages)

__ipath_release_user_pages(p, num_pages, 1);

current->mm->locked_vm -= num_pages;
current->mm->pinned_vm -= num_pages;

up_write(&current->mm->mmap_sem);
}
Expand All @@ -195,7 +195,7 @@ static void user_pages_account(struct work_struct *_work)
container_of(_work, struct ipath_user_pages_work, work);

down_write(&work->mm->mmap_sem);
work->mm->locked_vm -= work->num_pages;
work->mm->pinned_vm -= work->num_pages;
up_write(&work->mm->mmap_sem);
mmput(work->mm);
kfree(work);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/hw/qib/qib_user_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int __qib_get_user_pages(unsigned long start_page, size_t num_pages,
goto bail_release;
}

current->mm->locked_vm += num_pages;
current->mm->pinned_vm += num_pages;

ret = 0;
goto bail;
Expand Down Expand Up @@ -151,7 +151,7 @@ void qib_release_user_pages(struct page **p, size_t num_pages)
__qib_release_user_pages(p, num_pages, 1);

if (current->mm) {
current->mm->locked_vm -= num_pages;
current->mm->pinned_vm -= num_pages;
up_write(&current->mm->mmap_sem);
}
}
2 changes: 2 additions & 0 deletions trunk/fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
"VmPeak:\t%8lu kB\n"
"VmSize:\t%8lu kB\n"
"VmLck:\t%8lu kB\n"
"VmPin:\t%8lu kB\n"
"VmHWM:\t%8lu kB\n"
"VmRSS:\t%8lu kB\n"
"VmData:\t%8lu kB\n"
Expand All @@ -55,6 +56,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
hiwater_vm << (PAGE_SHIFT-10),
(total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
mm->locked_vm << (PAGE_SHIFT-10),
mm->pinned_vm << (PAGE_SHIFT-10),
hiwater_rss << (PAGE_SHIFT-10),
total_rss << (PAGE_SHIFT-10),
data << (PAGE_SHIFT-10),
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct mm_struct {
unsigned long hiwater_rss; /* High-watermark of RSS usage */
unsigned long hiwater_vm; /* High-water virtual memory usage */

unsigned long total_vm, locked_vm, shared_vm, exec_vm;
unsigned long total_vm, locked_vm, pinned_vm, shared_vm, exec_vm;
unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
unsigned long start_code, end_code, start_data, end_data;
unsigned long start_brk, brk, start_stack;
Expand Down
6 changes: 3 additions & 3 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ static void perf_mmap_close(struct vm_area_struct *vma)
struct ring_buffer *rb = event->rb;

atomic_long_sub((size >> PAGE_SHIFT) + 1, &user->locked_vm);
vma->vm_mm->locked_vm -= event->mmap_locked;
vma->vm_mm->pinned_vm -= event->mmap_locked;
rcu_assign_pointer(event->rb, NULL);
mutex_unlock(&event->mmap_mutex);

Expand Down Expand Up @@ -3625,7 +3625,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)

lock_limit = rlimit(RLIMIT_MEMLOCK);
lock_limit >>= PAGE_SHIFT;
locked = vma->vm_mm->locked_vm + extra;
locked = vma->vm_mm->pinned_vm + extra;

if ((locked > lock_limit) && perf_paranoid_tracepoint_raw() &&
!capable(CAP_IPC_LOCK)) {
Expand All @@ -3651,7 +3651,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
atomic_long_add(user_extra, &user->locked_vm);
event->mmap_locked = extra;
event->mmap_user = get_current_user();
vma->vm_mm->locked_vm += event->mmap_locked;
vma->vm_mm->pinned_vm += event->mmap_locked;

unlock:
if (!ret)
Expand Down

0 comments on commit 63b4158

Please sign in to comment.