aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--litmus/ctrldev.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/litmus/ctrldev.c b/litmus/ctrldev.c
index ec0fc4b1ab55..9969ab17c190 100644
--- a/litmus/ctrldev.c
+++ b/litmus/ctrldev.c
@@ -95,9 +95,16 @@ static int litmus_ctrl_mmap(struct file* filp, struct vm_area_struct* vma)
95 return -EINVAL; 95 return -EINVAL;
96 96
97 vma->vm_ops = &litmus_ctrl_vm_ops; 97 vma->vm_ops = &litmus_ctrl_vm_ops;
98 /* this mapping should not be kept across forks, 98 /* This mapping should not be kept across forks,
99 * and cannot be expanded */ 99 * cannot be expanded, and is not a "normal" page. */
100 vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; 100 vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND | VM_IO;
101
102 /* We don't want the first write access to trigger a "minor" page fault
103 * to mark the page as dirty. This is transient, private memory, we
104 * don't care if it was touched or not. __S011 means RW access, but not
105 * execute, and avoids copy-on-write behavior.
106 * See protection_map in mmap.c. */
107 vma->vm_page_prot = __S011;
101 108
102 err = alloc_ctrl_page(current); 109 err = alloc_ctrl_page(current);
103 if (!err) 110 if (!err)