Add some stubs for `madvise`.
This commit is contained in:
parent
3235175fcf
commit
e1633e7707
|
|
@ -90,18 +90,18 @@ Supported functionality in SCML:
|
|||
|
||||
Silently-ignored advice:
|
||||
* `MADV_DONTNEED`
|
||||
* `MADV_NOHUGEPAGE`
|
||||
* `MADV_HUGEPAGE`
|
||||
* `MADV_MERGEABLE`
|
||||
* `MADV_DONTFORK`
|
||||
|
||||
Unsupported advice:
|
||||
* `MADV_RANDOM`
|
||||
* `MADV_REMOVE`
|
||||
* `MADV_DONTFORK`
|
||||
* `MADV_DOFORK`
|
||||
* `MADV_HWPOISON`
|
||||
* `MADV_MERGEABLE`
|
||||
* `MADV_UNMERGEABLE`
|
||||
* `MADV_SOFT_OFFLINE`
|
||||
* `MADV_HUGEPAGE`
|
||||
* `MADV_NOHUGEPAGE`
|
||||
* `MADV_DONTDUMP`
|
||||
* `MADV_DODUMP`
|
||||
* `MADV_FREE`
|
||||
|
|
|
|||
|
|
@ -6,3 +6,6 @@ madvise(addr, length, advice = MADV_SEQUENTIAL);
|
|||
|
||||
// Prefetch pages for near-future access to reduce latency
|
||||
madvise(addr, length, advice = MADV_WILLNEED);
|
||||
|
||||
// Mark pages for lazy reclamation to allow the kernel to free them under memory pressure
|
||||
madvise(addr, length, advice = MADV_FREE);
|
||||
|
|
@ -48,6 +48,15 @@ pub fn sys_madvise(
|
|||
MadviseBehavior::MADV_NOHUGEPAGE => {
|
||||
warn!("MADV_NOHUGEPAGE isn't implemented, do nothing for now");
|
||||
}
|
||||
MadviseBehavior::MADV_HUGEPAGE => {
|
||||
warn!("MADV_HUGEPAGE isn't implemented, do nothing for now");
|
||||
}
|
||||
MadviseBehavior::MADV_MERGEABLE => {
|
||||
warn!("MADV_MERGEABLE isn't implemented, do nothing for now");
|
||||
}
|
||||
MadviseBehavior::MADV_DONTFORK => {
|
||||
warn!("MADV_DONTFORK isn't implemented, do nothing for now");
|
||||
}
|
||||
_ => todo!(),
|
||||
}
|
||||
Ok(SyscallReturn::Return(0))
|
||||
|
|
|
|||
Loading…
Reference in New Issue