aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/vm
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-06-06 17:38:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:17 -0400
commit33041a0d76d3c3e0aff28ac95a2ffdedf1282dbc (patch)
tree3abd944b4b7618abb6f4e143510b522479723a33 /Documentation/vm
parentcf2c81279eb0f66d382c0e889c266f8a57785cc4 (diff)
mm: mark remap_file_pages() syscall as deprecated
The remap_file_pages() system call is used to create a nonlinear mapping, that is, a mapping in which the pages of the file are mapped into a nonsequential order in memory. The advantage of using remap_file_pages() over using repeated calls to mmap(2) is that the former approach does not require the kernel to create additional VMA (Virtual Memory Area) data structures. Supporting of nonlinear mapping requires significant amount of non-trivial code in kernel virtual memory subsystem including hot paths. Also to get nonlinear mapping work kernel need a way to distinguish normal page table entries from entries with file offset (pte_file). Kernel reserves flag in PTE for this purpose. PTE flags are scarce resource especially on some CPU architectures. It would be nice to free up the flag for other usage. Fortunately, there are not many users of remap_file_pages() in the wild. It's only known that one enterprise RDBMS implementation uses the syscall on 32-bit systems to map files bigger than can linearly fit into 32-bit virtual address space. This use-case is not critical anymore since 64-bit systems are widely available. The plan is to deprecate the syscall and replace it with an emulation. The emulation will create new VMAs instead of nonlinear mappings. It's going to work slower for rare users of remap_file_pages() but ABI is preserved. One side effect of emulation (apart from performance) is that user can hit vm.max_map_count limit more easily due to additional VMAs. See comment for DEFAULT_MAX_MAP_COUNT for more details on the limit. [akpm@linux-foundation.org: fix spello] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Dave Jones <davej@redhat.com> Cc: Armin Rigo <arigo@tunes.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/vm')
-rw-r--r--Documentation/vm/remap_file_pages.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/vm/remap_file_pages.txt b/Documentation/vm/remap_file_pages.txt
new file mode 100644
index 000000000000..560e4363a55d
--- /dev/null
+++ b/Documentation/vm/remap_file_pages.txt
@@ -0,0 +1,28 @@
1The remap_file_pages() system call is used to create a nonlinear mapping,
2that is, a mapping in which the pages of the file are mapped into a
3nonsequential order in memory. The advantage of using remap_file_pages()
4over using repeated calls to mmap(2) is that the former approach does not
5require the kernel to create additional VMA (Virtual Memory Area) data
6structures.
7
8Supporting of nonlinear mapping requires significant amount of non-trivial
9code in kernel virtual memory subsystem including hot paths. Also to get
10nonlinear mapping work kernel need a way to distinguish normal page table
11entries from entries with file offset (pte_file). Kernel reserves flag in
12PTE for this purpose. PTE flags are scarce resource especially on some CPU
13architectures. It would be nice to free up the flag for other usage.
14
15Fortunately, there are not many users of remap_file_pages() in the wild.
16It's only known that one enterprise RDBMS implementation uses the syscall
17on 32-bit systems to map files bigger than can linearly fit into 32-bit
18virtual address space. This use-case is not critical anymore since 64-bit
19systems are widely available.
20
21The plan is to deprecate the syscall and replace it with an emulation.
22The emulation will create new VMAs instead of nonlinear mappings. It's
23going to work slower for rare users of remap_file_pages() but ABI is
24preserved.
25
26One side effect of emulation (apart from performance) is that user can hit
27vm.max_map_count limit more easily due to additional VMAs. See comment for
28DEFAULT_MAX_MAP_COUNT for more details on the limit.