MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_object_advice_applies

Function vm_object_advice_applies

freebsd/vm/vm_object.c:1262–1272  ·  view source on GitHub ↗

* Determine whether the given advice can be applied to the object. Advice is * not applied to unmanaged pages since they never belong to page queues, and * since MADV_FREE is destructive, it can apply only to anonymous pages that * have been mapped at most once. */

Source from the content-addressed store, hash-verified

1260 * have been mapped at most once.
1261 */
1262static bool
1263vm_object_advice_applies(vm_object_t object, int advice)
1264{
1265
1266 if ((object->flags & OBJ_UNMANAGED) != 0)
1267 return (false);
1268 if (advice != MADV_FREE)
1269 return (true);
1270 return ((object->flags & (OBJ_ONEMAPPING | OBJ_ANON)) ==
1271 (OBJ_ONEMAPPING | OBJ_ANON));
1272}
1273
1274static void
1275vm_object_madvise_freespace(vm_object_t object, int advice, vm_pindex_t pindex,

Callers 1

vm_object_madviseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected