• Home
  • Raw
  • Download

Lines Matching +full:linux +full:- +full:kernel

2 /// See [madvise()](https://man7.org/linux/man-pages/man2/madvise.2.html) map page.
10 pub fn normal() -> Self { in normal()
18 pub fn random() -> Self { in random()
27 pub fn sequential() -> Self { in sequential()
35 pub fn will_need() -> Self { in will_need()
43 /// so the kernel can free resources associated with it.)
49 /// from the up-to-date contents of the underlying mapped file
51 /// shmem-based techniques such as System V shared memory
52 /// segments) or zero-fill-on-demand pages for anonymous
57 /// range. The kernel is free to delay freeing the pages
63 /// pages, or VM_PFNMAP pages. (Pages marked with the kernel-
74 pub unsafe fn dont_need() -> Self { in dont_need()
79 // The rest are Linux-specific
81 /// **MADV_FREE** - Linux (since Linux 4.5) and Darwin
84 /// specified by addr and len. The kernel can thus free these
91 /// kernel frees the pages. However, subsequent writes to
92 /// pages in the range will succeed and then kernel cannot
95 /// the kernel can free the pages at any time. Once pages in
96 /// the range have been freed, the caller will see zero-fill-
97 /// on-demand pages upon subsequent page references.
100 /// anonymous pages (see mmap(2)). In Linux before version
110 #[cfg(any(target_os = "linux", target_os = "macos", target_os = "ios"))]
111 pub unsafe fn free() -> Self { in free()
115 /// **MADV_REMOVE** - Linux only (since Linux 2.6.16)
128 /// **MADV_REMOVE**; but since Linux 3.5, any filesystem which
139 #[cfg(target_os = "linux")]
140 pub unsafe fn remove() -> Self { in remove()
144 /// **MADV_DONTFORK** - Linux only (since Linux 2.6.16)
147 /// after a fork(2). This is useful to prevent copy-on-write
152 #[cfg(target_os = "linux")]
153 pub fn dont_fork() -> Self { in dont_fork()
157 /// **MADV_DOFORK** - Linux only (since Linux 2.6.16)
161 #[cfg(target_os = "linux")]
162 pub fn do_fork() -> Self { in do_fork()
166 /// **MADV_MERGEABLE** - Linux only (since Linux 2.6.32)
168 /// Enable Kernel Samepage Merging (KSM) for the pages in the
169 /// range specified by addr and length. The kernel regularly
172 /// These are replaced by a single write-protected page (which
180 /// power; use with care. See the Linux kernel source file
181 /// Documentation/admin-guide/mm/ksm.rst for more details.
184 /// available only if the kernel was configured with
186 #[cfg(target_os = "linux")]
187 pub fn mergeable() -> Self { in mergeable()
191 /// **MADV_UNMERGEABLE** - Linux only (since Linux 2.6.32)
197 #[cfg(target_os = "linux")]
198 pub fn unmergeable() -> Self { in unmergeable()
202 /// **MADV_HUGEPAGE** - Linux only (since Linux 2.6.38)
207 /// mmap(2)). The kernel will regularly scan the areas marked
209 /// The kernel will also allocate huge pages directly when the
218 /// of wired memory instead of one 4 KB page). See the Linux
219 /// kernel source file
220 /// Documentation/admin-guide/mm/transhuge.rst for more
223 /// Most common kernels configurations provide MADV_HUGEPAGE-
226 /// embedded systems, where MADV_HUGEPAGE-style behavior may
227 /// not be enabled by default in the kernel. On such systems,
236 /// available only if the kernel was configured with
238 #[cfg(target_os = "linux")]
239 pub fn huge_page() -> Self { in huge_page()
243 /// **MADV_NOHUGEPAGE** - Linux only (since Linux 2.6.38)
247 #[cfg(target_os = "linux")]
248 pub fn no_huge_page() -> Self { in no_huge_page()
252 /// **MADV_DONTDUMP** - Linux only (since Linux 3.4)
261 #[cfg(target_os = "linux")]
262 pub fn dont_dump() -> Self { in dont_dump()
266 /// **MADV_DODUMP** - Linux only (since Linux 3.4)
269 #[cfg(target_os = "linux")]
270 pub fn do_dump() -> Self { in do_dump()
274 /// **MADV_HWPOISON** - Linux only (since Linux 2.6.32)
283 /// This feature is intended for testing of memory error-
284 /// handling code; it is available only if the kernel was
286 #[cfg(target_os = "linux")]
287 pub fn hw_poison() -> Self { in hw_poison()
291 /// **MADV_POPULATE_READ** - Linux only (since Linux 5.14)
318 /// marked with kernel-internal flags such as VM_PFNMAP or VM_IO,
323 #[cfg(target_os = "linux")]
324 pub fn populate_read() -> Self { in populate_read()
328 /// **MADV_POPULATE_WRITE** - Linux only (since Linux 5.14)
352 /// marked with kernel-internal flags such as VM_PFNMAP or VM_IO,
357 #[cfg(target_os = "linux")]
358 pub fn populate_write() -> Self { in populate_write()
362 /// **MADV_ZERO_WIRED_PAGES** - Darwin only
369 pub fn zero_wired_pages() -> Self { in zero_wired_pages()
373 /// **MADV_FREE_REUSABLE** - Darwin only
383 pub unsafe fn free_reusable() -> Self { in free_reusable()
387 /// **MADV_FREE_REUSE** - Darwin only
389 /// Marks a memory region previously freed by **MADV_FREE_REUSABLE** as non-reusable, accounts
391 /// zero-filled pages on demand, other pages will be left as is.
399 pub unsafe fn free_reuse() -> Self { in free_reuse()
405 // MADV_SOFT_OFFLINE (since Linux 2.6.33)
406 // MADV_WIPEONFORK (since Linux 4.14)
407 // MADV_KEEPONFORK (since Linux 4.14)
408 // MADV_COLD (since Linux 5.4)
409 // MADV_PAGEOUT (since Linux 5.4)