Copyright (C) 2001 Chad David <firstname.lastname@example.org>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice(s), this list of conditions and the following disclaimer as the first lines of this file unmodified other than the possible addition of one or more copyright notices. 2. Redistributions in binary for...
NAMEvm_page_free vm_page_free_toq vm_page_free_zero vm_page_try_to_free - free a page
SYNOPSISIn sys/param.h In vm/vm.h In vm/vm_page.h Ft void Fn vm_page_free vm_page_t m Ft void Fn vm_page_free_toq vm_page_t m Ft void Fn vm_page_free_zero vm_page_t m Ft int Fn vm_page_try_to_free vm_page_t m
DESCRIPTIONThe Fn vm_page_free_toq function moves a page into the free queue, and disassociates it from its object. If the page is held, wired, already free, or its busy count is not zero, the system will panic. If the PG_ZERO flag is set on the page, it is placed at the end of the free queue; otherwise, it is placed at the front.
If the page's object is of type OBJT_VNODE and it is the last page associated with the object, the underlying vnode may be freed.
The Fn vm_page_free and Fn vm_page_free_zero functions both call Fn vm_page_free_toq to actually free the page, but Fn vm_page_free_zero sets the PG_ZERO flag and Fn vm_page_free clears the PG_ZERO flag prior to the call to Fn vm_page_free_toq .
The Fn vm_page_try_to_free function verifies that the page is not held, wired, busy or dirty, and if so, marks the page as busy, drops any protection that may be set on the page, and frees it.