diff options
author | jeff <jeff@FreeBSD.org> | 2013-04-06 22:21:23 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2013-04-06 22:21:23 +0000 |
commit | fa887dba7b511d88568bd53f128474c5635f9264 (patch) | |
tree | f92f1ee66b920b82d9dc8a70d926782646206139 /sys/vm | |
parent | 440815b543293719279de0cbf109c7ab03f7caa0 (diff) | |
download | FreeBSD-src-fa887dba7b511d88568bd53f128474c5635f9264.zip FreeBSD-src-fa887dba7b511d88568bd53f128474c5635f9264.tar.gz |
Prepare to replace the buf splay with a trie:
- Don't insert BKGRDMARKER bufs into the splay or dirty/clean buf lists.
No consumers need to find them there and it complicates the tree.
These flags are all FFS specific and could be moved out of the buf
cache.
- Use pbgetvp() and pbrelvp() to associate the background and journal
bufs with the vp. Not only is this much cheaper it makes more sense
for these transient bufs.
- Fix the assertions in pbget* and pbrel*. It's not safe to check list
pointers which were never initialized. Use the BX flags instead. We
also check B_PAGING in reassignbuf() so this should cover all cases.
Discussed with: kib, mckusick, attilio
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_pager.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index a991e41..989c318 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -469,17 +469,9 @@ pbrelvp(struct buf *bp) KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL")); KASSERT(bp->b_bufobj != NULL, ("pbrelvp: NULL bufobj")); + KASSERT((bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) == 0, + ("pbrelvp: pager buf on vnode list.")); - /* XXX REMOVE ME */ - BO_LOCK(bp->b_bufobj); - if (TAILQ_NEXT(bp, b_bobufs) != NULL) { - panic( - "relpbuf(): b_vp was probably reassignbuf()d %p %x", - bp, - (int)bp->b_flags - ); - } - BO_UNLOCK(bp->b_bufobj); bp->b_vp = NULL; bp->b_bufobj = NULL; bp->b_flags &= ~B_PAGING; @@ -494,17 +486,9 @@ pbrelbo(struct buf *bp) KASSERT(bp->b_vp == NULL, ("pbrelbo: vnode")); KASSERT(bp->b_bufobj != NULL, ("pbrelbo: NULL bufobj")); + KASSERT((bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) == 0, + ("pbrelbo: pager buf on vnode list.")); - /* XXX REMOVE ME */ - BO_LOCK(bp->b_bufobj); - if (TAILQ_NEXT(bp, b_bobufs) != NULL) { - panic( - "relpbuf(): b_vp was probably reassignbuf()d %p %x", - bp, - (int)bp->b_flags - ); - } - BO_UNLOCK(bp->b_bufobj); bp->b_bufobj = NULL; bp->b_flags &= ~B_PAGING; } |