History

mm: Define MAP_SYNC and VM_SYNC flags

Define new MAP_SYNC flag and corresponding VMA VM_SYNC flag. As the MAP_SYNC flag is not part of LEGACY_MAP_MASK, currently it will be refused by all MAP_SHARED_VALIDATE map attempts and silently ignored for everything else.

Jan Kara committed 9 years ago

Commit b6fb2931 parent f5b7b744 files · +9 −2Browse files

Unified · Split

4 files
  1. fs/proc/task_mmu.c +1 −0
  2. include/linux/mm.h +1 −0
  3. include/linux/mman.h +6 −2
  4. include/uapi/asm-generic/mman.h +1 −0
fs/proc/task_mmu.c+1−0
@@ -664,6 +664,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) · 663 unmodified lines
664664 [ilog2(VM_ACCOUNT)] = "ac",
665665 [ilog2(VM_NORESERVE)] = "nr",
666666 [ilog2(VM_HUGETLB)] = "ht",
667+ [ilog2(VM_SYNC)] = "sf",
667668 [ilog2(VM_ARCH_1)] = "ar",
668669 [ilog2(VM_WIPEONFORK)] = "wf",
669670 [ilog2(VM_DONTDUMP)] = "dd",
include/linux/mm.h+1−0
@@ -189,6 +189,7 @@ extern unsigned int kobjsize(const void *objp); · 188 unmodified lines
189189 #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
190190 #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */
191191 #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
192+#define VM_SYNC 0x00800000 /* Synchronous page faults */
192193 #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
193194 #define VM_WIPEONFORK 0x02000000 /* Wipe VMA contents in child. */
194195 #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */
include/linux/mman.h+6−2
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 /*
1111 * Arrange for legacy / undefined architecture specific flags to be
12− * ignored by default in LEGACY_MAP_MASK.
12+ * ignored by mmap handling code.
1313 */
1414 #ifndef MAP_32BIT
1515 #define MAP_32BIT 0
@@ -23,6 +23,9 @@ · 7 unmodified lines
2323 #ifndef MAP_UNINITIALIZED
2424 #define MAP_UNINITIALIZED 0
2525 #endif
26+#ifndef MAP_SYNC
27+#define MAP_SYNC 0
28+#endif
2629
2730 /*
2831 * The historical set of flags that all mmap implementations implicitly
@@ -126,7 +129,8 @@ calc_vm_flag_bits(unsigned long flags) · 97 unmodified lines
126129 {
127130 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |
128131 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) |
129− _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
132+ _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) |
133+ _calc_vm_trans(flags, MAP_SYNC, VM_SYNC );
130134 }
131135
132136 unsigned long vm_commit_limit(void);
include/uapi/asm-generic/mman.h+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #define MAP_NONBLOCK 0x10000 /* do not block on IO */
1313 #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
1414 #define MAP_HUGETLB 0x40000 /* create a huge page mapping */
15+#define MAP_SYNC 0x80000 /* perform synchronous page faults for the mapping */
1516
1617 /* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */
1718

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t