* vm_page_drop: * * Release a reference to a page and return the old reference count. */
| 952 | * Release a reference to a page and return the old reference count. |
| 953 | */ |
| 954 | static inline u_int |
| 955 | vm_page_drop(vm_page_t m, u_int val) |
| 956 | { |
| 957 | u_int old; |
| 958 | |
| 959 | /* |
| 960 | * Synchronize with vm_page_free_prep(): ensure that all updates to the |
| 961 | * page structure are visible before it is freed. |
| 962 | */ |
| 963 | atomic_thread_fence_rel(); |
| 964 | old = atomic_fetchadd_int(&m->ref_count, -val); |
| 965 | KASSERT(old != VPRC_BLOCKED, |
| 966 | ("vm_page_drop: page %p has an invalid refcount value", m)); |
| 967 | return (old); |
| 968 | } |
| 969 | |
| 970 | /* |
| 971 | * vm_page_wired: |
no test coverage detected