Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164424
b: refs/heads/master
c: 7103ad3
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Sep 22, 2009
1 parent 9839abf commit 406f197
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 35451beecbd7c86ce3249d543594517a5fe9a0cd
refs/heads/master: 7103ad323b1ae32bedc3267402117e2f8b45e48d
8 changes: 5 additions & 3 deletions trunk/mm/mremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static unsigned long move_vma(struct vm_area_struct *vma,
unsigned long excess = 0;
unsigned long hiwater_vm;
int split = 0;
int err;

/*
* We'd prefer to avoid failure later on in do_munmap:
Expand All @@ -190,9 +191,10 @@ static unsigned long move_vma(struct vm_area_struct *vma,
* pages recently unmapped. But leave vma->vm_flags as it was,
* so KSM can come around to merge on vma and new_vma afterwards.
*/
if (ksm_madvise(vma, old_addr, old_addr + old_len,
MADV_UNMERGEABLE, &vm_flags))
return -ENOMEM;
err = ksm_madvise(vma, old_addr, old_addr + old_len,
MADV_UNMERGEABLE, &vm_flags);
if (err)
return err;

new_pgoff = vma->vm_pgoff + ((old_addr - vma->vm_start) >> PAGE_SHIFT);
new_vma = copy_vma(&vma, new_addr, new_len, new_pgoff);
Expand Down

0 comments on commit 406f197

Please sign in to comment.