Selectively inline vm_page_dirty().

This commit is contained in:
alc 2012-06-20 23:25:47 +00:00
parent d7c61f6b4f
commit 4d96d753fe
2 changed files with 28 additions and 3 deletions

View File

@ -783,7 +783,7 @@ vm_page_sleep(vm_page_t m, const char *msg)
}
/*
* vm_page_dirty:
* vm_page_dirty_KBI: [ internal use only ]
*
* Set all bits in the page's dirty field.
*
@ -791,11 +791,14 @@ vm_page_sleep(vm_page_t m, const char *msg)
* call is made from the machine-independent layer.
*
* See vm_page_clear_dirty_mask().
*
* This function should only be called by vm_page_dirty().
*/
void
vm_page_dirty(vm_page_t m)
vm_page_dirty_KBI(vm_page_t m)
{
/* These assertions refer to this operation by its public name. */
KASSERT((m->flags & PG_CACHED) == 0,
("vm_page_dirty: page in cache!"));
KASSERT(!VM_PAGE_IS_FREE(m),

View File

@ -360,7 +360,6 @@ void vm_page_hold(vm_page_t mem);
void vm_page_unhold(vm_page_t mem);
void vm_page_free(vm_page_t m);
void vm_page_free_zero(vm_page_t m);
void vm_page_dirty(vm_page_t m);
void vm_page_wakeup(vm_page_t m);
void vm_pageq_remove(vm_page_t m);
@ -414,6 +413,7 @@ void vm_page_cowfault (vm_page_t);
int vm_page_cowsetup(vm_page_t);
void vm_page_cowclear (vm_page_t);
void vm_page_dirty_KBI(vm_page_t m);
void vm_page_lock_KBI(vm_page_t m, const char *file, int line);
void vm_page_unlock_KBI(vm_page_t m, const char *file, int line);
int vm_page_trylock_KBI(vm_page_t m, const char *file, int line);
@ -428,6 +428,28 @@ void vm_page_object_lock_assert(vm_page_t m);
#define VM_PAGE_OBJECT_LOCK_ASSERT(m) (void)0
#endif
/*
* vm_page_dirty:
*
* Set all bits in the page's dirty field.
*
* The object containing the specified page must be locked if the
* call is made from the machine-independent layer.
*
* See vm_page_clear_dirty_mask().
*/
static __inline void
vm_page_dirty(vm_page_t m)
{
/* Use vm_page_dirty_KBI() under INVARIANTS to save memory. */
#if defined(KLD_MODULE) || defined(INVARIANTS)
vm_page_dirty_KBI(m);
#else
m->dirty = VM_PAGE_BITS_ALL;
#endif
}
/*
* vm_page_sleep_if_busy:
*