diff options
author | alc <alc@FreeBSD.org> | 2013-06-03 01:22:54 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2013-06-03 01:22:54 +0000 |
commit | 17993ced1b8bde5d02a6fa8fe966058a330ba5b2 (patch) | |
tree | c27fe59254b72779ab022da2ffc0aa1237f02da8 /sys/vm/vm_page.c | |
parent | 65a84eb69172562654a06edf22d47a0a80d57b4f (diff) | |
download | FreeBSD-src-17993ced1b8bde5d02a6fa8fe966058a330ba5b2.zip FreeBSD-src-17993ced1b8bde5d02a6fa8fe966058a330ba5b2.tar.gz |
Require that the page lock is held, instead of the object lock, when
clearing the page's PGA_REFERENCED flag. Since we are typically
manipulating the page's act_count field when we are clearing its
PGA_REFERENCED flag, the page lock is already held everywhere that we clear
the PGA_REFERENCED flag. So, in fact, this revision only changes some
comments and an assertion. Nonetheless, it will enable later changes to
object locking in the pageout code.
Introduce vm_page_assert_locked(), which completely hides the implementation
details of the page lock from the caller, and use it in
vm_page_aflag_clear(). (The existing vm_page_lock_assert() could not be
used in vm_page_aflag_clear().) Over the coming weeks, I expect that we'll
either eliminate or replace the various uses of vm_page_lock_assert() with
vm_page_assert_locked().
Reviewed by: attilio
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 5a1c055..b6fbb93 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2725,6 +2725,13 @@ vm_page_trylock_KBI(vm_page_t m, const char *file, int line) #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void +vm_page_assert_locked_KBI(vm_page_t m, const char *file, int line) +{ + + vm_page_lock_assert_KBI(m, MA_OWNED, file, line); +} + +void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line) { |