* 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. */
| 1260 | * have been mapped at most once. |
| 1261 | */ |
| 1262 | static bool |
| 1263 | vm_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 | |
| 1274 | static void |
| 1275 | vm_object_madvise_freespace(vm_object_t object, int advice, vm_pindex_t pindex, |