Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118908
b: refs/heads/master
c: 8891d6d
h: refs/heads/master
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Nov 13, 2008
1 parent e65e004 commit 859753c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 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: a189d0350f387786b1fb5a5d19e3a5ab0bc0cceb
refs/heads/master: 8891d6da17db0f9bb507d3a017f130b9970c3087
16 changes: 6 additions & 10 deletions trunk/mm/mlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,10 @@ void __clear_page_mlock(struct page *page)
putback_lru_page(page);
} else {
/*
* Page not on the LRU yet. Flush all pagevecs and retry.
* We lost the race. the page already moved to evictable list.
*/
lru_add_drain_all();
if (!isolate_lru_page(page))
putback_lru_page(page);
else if (PageUnevictable(page))
if (PageUnevictable(page))
count_vm_event(UNEVICTABLE_PGSTRANDED);

}
}

Expand Down Expand Up @@ -187,8 +183,6 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
if (vma->vm_flags & VM_WRITE)
gup_flags |= GUP_FLAGS_WRITE;

lru_add_drain_all(); /* push cached pages to LRU */

while (nr_pages > 0) {
int i;

Expand Down Expand Up @@ -251,8 +245,6 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
ret = 0;
}

lru_add_drain_all(); /* to update stats */

return ret; /* count entire vma as locked_vm */
}

Expand Down Expand Up @@ -546,6 +538,8 @@ asmlinkage long sys_mlock(unsigned long start, size_t len)
if (!can_do_mlock())
return -EPERM;

lru_add_drain_all(); /* flush pagevec */

down_write(&current->mm->mmap_sem);
len = PAGE_ALIGN(len + (start & ~PAGE_MASK));
start &= PAGE_MASK;
Expand Down Expand Up @@ -612,6 +606,8 @@ asmlinkage long sys_mlockall(int flags)
if (!can_do_mlock())
goto out;

lru_add_drain_all(); /* flush pagevec */

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

lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur;
Expand Down

0 comments on commit 859753c

Please sign in to comment.