diff options
author | alc <alc@FreeBSD.org> | 2009-05-30 22:06:58 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2009-05-30 22:06:58 +0000 |
commit | e4bf0af67f214fd95ccbe19f6ce9336528777f7b (patch) | |
tree | 257f22387f1bf051f9c9d436dfadb1e71e17348a /sys/vm | |
parent | c3ba7754cdf2a6f3e5aed6f9135b370e1c0abc52 (diff) | |
download | FreeBSD-src-e4bf0af67f214fd95ccbe19f6ce9336528777f7b.zip FreeBSD-src-e4bf0af67f214fd95ccbe19f6ce9336528777f7b.tar.gz |
Add assertions in two places where a page's valid or dirty bits are changed.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f0f9042..370aea0 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -566,10 +566,13 @@ vm_page_sleep(vm_page_t m, const char *msg) void vm_page_dirty(vm_page_t m) { + KASSERT((m->flags & PG_CACHED) == 0, ("vm_page_dirty: page in cache!")); KASSERT(!VM_PAGE_IS_FREE(m), ("vm_page_dirty: page is free!")); + KASSERT(m->valid == VM_PAGE_BITS_ALL, + ("vm_page_dirty: page is invalid!")); m->dirty = VM_PAGE_BITS_ALL; } @@ -1891,6 +1894,13 @@ vm_page_set_valid(vm_page_t m, int base, int size) DEV_BSIZE - (endoff & (DEV_BSIZE - 1))); /* + * Assert that no previously invalid block that is now being validated + * is already dirty. + */ + KASSERT((~m->valid & vm_page_bits(base, size) & m->dirty) == 0, + ("vm_page_set_valid: page %p is dirty", m)); + + /* * Set valid bits inclusive of any overlap. */ m->valid |= vm_page_bits(base, size); |