Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332339
b: refs/heads/master
c: 4b6e1e3
h: refs/heads/master
i:
  332337: 3447c8f
  332335: 08af4a2
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Oct 9, 2012
1 parent b6d67f3 commit 2c3c0c5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 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: cc2383ec06be093789469852e1fe96e1148e9a2c
refs/heads/master: 4b6e1e37026ec7dae9b23d78ffcebdd5ddb1bfa1
1 change: 0 additions & 1 deletion trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ extern unsigned int kobjsize(const void *objp);
#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
#define VM_NODUMP 0x04000000 /* Do not include in the core dump */

#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
Expand Down
3 changes: 1 addition & 2 deletions trunk/mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,7 @@ int split_huge_page(struct page *page)
return ret;
}

#define VM_NO_THP (VM_SPECIAL|VM_INSERTPAGE|VM_MIXEDMAP| \
VM_HUGETLB|VM_SHARED|VM_MAYSHARE)
#define VM_NO_THP (VM_SPECIAL|VM_MIXEDMAP|VM_HUGETLB|VM_SHARED|VM_MAYSHARE)

int hugepage_madvise(struct vm_area_struct *vma,
unsigned long *vm_flags, int advice)
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
*/
if (*vm_flags & (VM_MERGEABLE | VM_SHARED | VM_MAYSHARE |
VM_PFNMAP | VM_IO | VM_DONTEXPAND |
VM_RESERVED | VM_HUGETLB | VM_INSERTPAGE |
VM_RESERVED | VM_HUGETLB |
VM_NONLINEAR | VM_MIXEDMAP))
return 0; /* just ignore the advice */

Expand Down
14 changes: 12 additions & 2 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,8 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
* readonly mappings. The tradeoff is that copy_page_range is more
* efficient than faulting.
*/
if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP|VM_INSERTPAGE))) {
if (!(vma->vm_flags & (VM_HUGETLB | VM_NONLINEAR |
VM_PFNMAP | VM_MIXEDMAP))) {
if (!vma->anon_vma)
return 0;
}
Expand Down Expand Up @@ -2085,6 +2086,11 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
* ask for a shared writable mapping!
*
* The page does not need to be reserved.
*
* Usually this function is called from f_op->mmap() handler
* under mm->mmap_sem write-lock, so it can change vma->vm_flags.
* Caller must set VM_MIXEDMAP on vma if it wants to call this
* function from other places, for example from page-fault handler.
*/
int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
struct page *page)
Expand All @@ -2093,7 +2099,11 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
return -EFAULT;
if (!page_count(page))
return -EINVAL;
vma->vm_flags |= VM_INSERTPAGE;
if (!(vma->vm_flags & VM_MIXEDMAP)) {
BUG_ON(down_read_trylock(&vma->vm_mm->mmap_sem));
BUG_ON(vma->vm_flags & VM_PFNMAP);
vma->vm_flags |= VM_MIXEDMAP;
}
return insert_page(vma, addr, page, vma->vm_page_prot);
}
EXPORT_SYMBOL(vm_insert_page);
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
return 0;

/* Specialty mapping? */
if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE))
if (vm_flags & VM_PFNMAP)
return 0;

/* Can the mapping track the dirty pages? */
Expand Down

0 comments on commit 2c3c0c5

Please sign in to comment.