Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230727
b: refs/heads/master
c: 5fdb200
h: refs/heads/master
i:
  230725: 115c6fd
  230723: a7d9ec7
  230719: fdd8e45
v: v3
  • Loading branch information
Michel Lespinasse authored and Linus Torvalds committed Jan 14, 2011
1 parent 8861c76 commit 95fbad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 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: 110d74a921f4d272b47ef6104fcf937df808f4c8
refs/heads/master: 5fdb2002131cd4e210b9638a4fc932ec7be491d1
26 changes: 13 additions & 13 deletions trunk/mm/mlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
VM_BUG_ON(end > vma->vm_end);
VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem));

gup_flags = FOLL_TOUCH | FOLL_MLOCK;
gup_flags = FOLL_TOUCH;
/*
* We want to touch writable mappings with a write fault in order
* to break COW, except for shared mappings because these don't COW
Expand All @@ -178,6 +178,9 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE)
gup_flags |= FOLL_WRITE;

if (vma->vm_flags & VM_LOCKED)
gup_flags |= FOLL_MLOCK;

/* We don't try to access the guard page of a stack vma */
if (stack_guard_page(vma, start)) {
addr += PAGE_SIZE;
Expand Down Expand Up @@ -456,18 +459,15 @@ static int do_mlock_pages(unsigned long start, size_t len, int ignore_errors)
/*
* Now fault in a range of pages within the first VMA.
*/
if (vma->vm_flags & VM_LOCKED) {
ret = __mlock_vma_pages_range(vma, nstart, nend);
if (ret < 0 && ignore_errors) {
ret = 0;
continue; /* continue at next VMA */
}
if (ret) {
ret = __mlock_posix_error_return(ret);
break;
}
} else
make_pages_present(nstart, nend);
ret = __mlock_vma_pages_range(vma, nstart, nend);
if (ret < 0 && ignore_errors) {
ret = 0;
continue; /* continue at next VMA */
}
if (ret) {
ret = __mlock_posix_error_return(ret);
break;
}
}
up_read(&mm->mmap_sem);
return ret; /* 0 or negative error code */
Expand Down

0 comments on commit 95fbad2

Please sign in to comment.