Author: alc Date: Wed Jun 20 23:25:47 2012 New Revision: 237346 URL: http://svn.freebsd.org/changeset/base/237346
Log: Selectively inline vm_page_dirty(). Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jun 20 22:21:02 2012 (r237345) +++ head/sys/vm/vm_page.c Wed Jun 20 23:25:47 2012 (r237346) @@ -783,7 +783,7 @@ vm_page_sleep(vm_page_t m, const char *m } /* - * 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 *m * 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), Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Jun 20 22:21:02 2012 (r237345) +++ head/sys/vm/vm_page.h Wed Jun 20 23:25:47 2012 (r237346) @@ -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); @@ -429,6 +429,28 @@ void vm_page_object_lock_assert(vm_page_ #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: * * Sleep and release the page queues lock if VPO_BUSY is set or, _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"