Home
last modified time | relevance | path

Searched refs:madvise (Results 1 - 25 of 84) sorted by relevance

1234

/third_party/rust/crates/rustix/src/mm/
H A Dmod.rs4 mod madvise; modules
11 pub use madvise::{madvise, Advice};
H A Dmadvise.rs1 //! The `madvise` function.
5 //! `madvise` operates on a raw pointer. Some forms of `madvise` may
25 /// - [Linux `madvise`]
29 /// [Linux `madvise`]: https://man7.org/linux/man-pages/man2/madvise.2.html
33 pub unsafe fn madvise(addr: *mut c_void, len: usize, advice: Advice) -> io::Result<()> { in madvise() functions
34 backend::mm::syscalls::madvise(addr, len, advice) in madvise()
/third_party/ltp/testcases/kernel/mem/thp/
H A Dthp04.c50 TEST(madvise(ret, thp_size, MADV_HUGEPAGE)); in alloc_zero_page()
54 "madvise(MADV_HUGEPAGE) not supported"); in alloc_zero_page()
59 "madvise(MADV_HUGEPAGE) failed"); in alloc_zero_page()
106 madvise(write_thp, thp_size, MADV_DONTNEED); in thread_run()
111 /* Wait for dirty page handling before next madvise() */ in thread_run()
128 madvise(write_thp, thp_size, MADV_DONTNEED); in run()
133 madvise(read_thp, thp_size, MADV_DONTNEED); in run()
H A Dthp03.c59 if (madvise(p + hugepage_size, page_size, MADV_MERGEABLE) == -1) { in thp_test()
64 tst_brk(TBROK | TERRNO, "madvise"); in thp_test()
/third_party/rust/crates/rustix/src/backend/libc/mm/
H A Dsyscalls.rs21 pub(crate) fn madvise(addr: *mut c::c_void, len: usize, advice: Advice) -> io::Result<()> {
27 return unsafe { ret(c::madvise(addr, len, c::MADV_DONTNEED)) };
49 unsafe { ret(c::madvise(addr, len, advice as c::c_int)) }
/third_party/rust/crates/rustix/tests/mm/
H A Dmmap.rs134 use rustix::mm::{madvise, mmap_anonymous, munmap, Advice, MapFlags, ProtFlags}; in test_madvise()
140 madvise(addr, 8192, Advice::Normal).unwrap(); in test_madvise()
141 madvise(addr, 8192, Advice::DontNeed).unwrap(); in test_madvise()
144 madvise(addr, 8192, Advice::LinuxDontNeed).unwrap(); in test_madvise()
/third_party/node/deps/v8/src/base/platform/
H A Dplatform-posix.cc77 extern "C" int madvise(caddr_t, size_t, int);
79 extern int madvise(caddr_t, size_t, int);
180 madvise(result, size, MADV_DONTFORK); in Allocate()
192 madvise(reinterpret_cast<void*>(huge_start), huge_end - huge_start, in Allocate()
482 // rwx to none. Just use madvise instead. in SetPermissions()
485 ret = madvise(address, size, MADV_FREE_REUSABLE); in SetPermissions()
503 madvise(address, size, MADV_FREE_REUSE); in SetPermissions()
519 int ret = madvise(address, size, MADV_FREE_REUSABLE); in DiscardSystemPages()
522 ret = madvise(address, size, MADV_DONTNEED); in DiscardSystemPages()
525 int ret = madvise(reinterpret_cas in DiscardSystemPages()
[all...]
/third_party/musl/libc-test/src/functionalext/supplement/mman/
H A Dmadvise.c56 int ret = madvise(ptr, length, MADV_NORMAL); in madvise_0100()
81 int ret = madvise(ptr, errorlen, MADV_NORMAL); in madvise_0200()
/third_party/mesa3d/src/panfrost/drm-shim/
H A Dpanfrost_noop.c120 struct drm_panfrost_madvise *madvise = arg; in pan_ioctl_madvise() local
122 madvise->retained = 1; in pan_ioctl_madvise()
/third_party/mesa3d/src/freedreno/drm/
H A Dfreedreno_bo_cache.c171 if (bo->funcs->madvise(bo, true) <= 0) { in fd_bo_cache_alloc()
201 bo->funcs->madvise(bo, false); in fd_bo_cache_free()
/third_party/libdrm/freedreno/
H A Dfreedreno_bo_cache.c177 if (bo->funcs->madvise(bo, TRUE) <= 0) { in fd_bo_cache_alloc()
202 bo->funcs->madvise(bo, FALSE); in fd_bo_cache_free()
/third_party/ltp/testcases/kernel/mce-test/tsrc/
H A Dttranshuge.c161 * madvise.
169 * Title: thp: khugepaged: make khugepaged aware about madvise
177 return madvise((void *)madvise_addr, madvise_size, MADV_HUGEPAGE); in request_thp_with_madvise()
216 /* enabled(=madvise) in /sys/kernel/mm/transparent_hugepage/. */ in prep_injection()
218 print_err("Failed to request THP for [madvise] in enabled.\n"); in prep_injection()
252 if (madvise((void *)corrupt_page_addr, DEFAULT_PS, MADV_POISON) != 0) { in do_injection()
H A Dtkillpoison.c15 madvise(ptr, PS, MADV_POISON); in main()
H A Dtsoft.c23 if (madvise(map, PS, MADV_SOFT_OFFLINE) < 0) in main()
24 perror("madvise SOFT_OFFLINE"); in main()
/third_party/ltp/testcases/kernel/mce-test/hwpoison/
H A Dttranshuge.c161 * madvise.
169 * Title: thp: khugepaged: make khugepaged aware about madvise
177 return madvise((void *)madvise_addr, madvise_size, MADV_HUGEPAGE); in request_thp_with_madvise()
216 /* enabled(=madvise) in /sys/kernel/mm/transparent_hugepage/. */ in prep_injection()
218 print_err("Failed to request THP for [madvise] in enabled.\n"); in prep_injection()
252 if (madvise((void *)corrupt_page_addr, DEFAULT_PS, MADV_POISON) != 0) { in do_injection()
H A Dtkillpoison.c15 madvise(ptr, PS, MADV_POISON); in main()
H A Dtsoft.c23 if (madvise(map, PS, MADV_SOFT_OFFLINE) < 0) in main()
24 perror("madvise SOFT_OFFLINE"); in main()
/third_party/ltp/testcases/kernel/syscalls/madvise/
H A Dmadvise06.c9 * Page fault occurs in spite that madvise(WILLNEED) system call is called
11 * which sequentially accesses to a shared memory and calls madvise(WILLNEED)
21 * mm: madvise: fix MADV_WILLNEED on shmem swapouts
24 * changes during madvise. When the pages are dirtied, about half
26 * moved into Swap. When madvise is run it will cause the pages
32 * Secondly we run madvise again, but only on the first
41 * e6e88712e43b ("mm: optimise madvise WILLNEED")
43 * 66383800df9c ("mm: fix madvise WILLNEED performance problem").
182 meminfo_diag("Before madvise"); in test_advice_willneed()
186 TEST(madvise(targe in test_advice_willneed()
[all...]
H A Dmadvise05.c6 * This is a regression test for madvise(2) system call. It tests kernel
11 * mm: Fix NULL pointer dereference in madvise(MADV_WILLNEED) support
34 TEST(madvise(p, ALLOC_SIZE, MADV_WILLNEED)); in verify_madvise()
45 tst_brk(TBROK | TTERRNO, "madvise failed"); in verify_madvise()
H A Dmadvise03.c10 * Check that successful madvise(2) MADV_DONTNEED operation will result in
26 TEST(madvise(addr, MAP_SIZE, MADV_DONTNEED)); in run()
28 tst_brk(TBROK | TTERRNO, "madvise(%p, %d, 0x%x) failed", in run()
/third_party/python/Lib/test/
H A Dtest_mmap.py795 @unittest.skipUnless(hasattr(mmap.mmap, 'madvise'), 'needs madvise')
800 with self.assertRaisesRegex(ValueError, "madvise start out of bounds"):
801 m.madvise(mmap.MADV_NORMAL, size)
802 with self.assertRaisesRegex(ValueError, "madvise start out of bounds"):
803 m.madvise(mmap.MADV_NORMAL, -1)
804 with self.assertRaisesRegex(ValueError, "madvise length invalid"):
805 m.madvise(mmap.MADV_NORMAL, 0, -1)
806 with self.assertRaisesRegex(OverflowError, "madvise length too large"):
807 m.madvise(mma
[all...]
/third_party/musl/src/mman/
H A Dmadvise.c9 weak_alias(__madvise, madvise);
/third_party/musl/libc-test/src/functionalext/supplement/mman/mman_gtest/
H A Dmman_madvise_test.cpp27 int result = madvise(addr, LEN, MADV_NORMAL); in HWTEST_F()
/third_party/ltp/testcases/kernel/mem/hugetlb/hugemmap/
H A Dhugemmap16.c10 * madvise() on some kernels can cause the reservation counter to get
46 if (madvise(p, hpage_size, MADV_WILLNEED) == -1) in run_test()
47 tst_brk(TBROK|TERRNO, "madvise()"); in run_test()
49 tst_res(TINFO, "Reserve count after madvise: %lu", madvise_rsvd); in run_test()
/third_party/ltp/testcases/kernel/mem/ksm/
H A Dksm05.c70 if (madvise(ptr, ps, MADV_MERGEABLE) < 0) in test_ksm()
71 tst_brk(TBROK | TERRNO, "madvise"); in test_ksm()

Completed in 9 milliseconds

1234