diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-09 13:41:04 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-09 13:41:04 +0000 |
commit | 4c30b61f93fb9731c5c60e12e185bc9ec2844781 (patch) | |
tree | 43ec0ba0d9b052dbf821476faf7eae598c603824 /sys | |
parent | 6b311f3cfec9cdac33236ddb5e9700cc7b431ac4 (diff) |
Use an RB tree instead of a SPLAY tree for the page headers tree.
ok beck@, dlg@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_pool.c | 16 | ||||
-rw-r--r-- | sys/sys/pool.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index c7b2d814431..b59b1efe90d 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.86 2009/07/30 18:19:26 deraadt Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.87 2009/08/09 13:41:03 thib Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -69,7 +69,7 @@ struct pool_item_header { LIST_ENTRY(pool_item_header) ph_pagelist; /* pool page list */ TAILQ_HEAD(,pool_item) ph_itemlist; /* chunk list for this page */ - SPLAY_ENTRY(pool_item_header) + RB_ENTRY(pool_item_header) ph_node; /* Off-page page headers */ int ph_nmissing; /* # of chunks in use */ caddr_t ph_page; /* this page's address */ @@ -150,8 +150,8 @@ phtree_compare(struct pool_item_header *a, struct pool_item_header *b) return (0); } -SPLAY_PROTOTYPE(phtree, pool_item_header, ph_node, phtree_compare); -SPLAY_GENERATE(phtree, pool_item_header, ph_node, phtree_compare); +RB_PROTOTYPE(phtree, pool_item_header, ph_node, phtree_compare); +RB_GENERATE(phtree, pool_item_header, ph_node, phtree_compare); /* * Return the pool page header based on page address. @@ -182,7 +182,7 @@ pr_find_pagehead(struct pool *pp, void *v) */ tmp.ph_page = v; tmp.ph_pagesize = 0; - ph = SPLAY_FIND(phtree, &pp->pr_phtree, &tmp); + ph = RB_FIND(phtree, &pp->pr_phtree, &tmp); if (ph) { KASSERT(ph->ph_page <= (caddr_t)v); @@ -219,7 +219,7 @@ pr_rmpage(struct pool *pp, struct pool_item_header *ph, */ LIST_REMOVE(ph, ph_pagelist); if ((pp->pr_roflags & PR_PHINPAGE) == 0) - SPLAY_REMOVE(phtree, &pp->pr_phtree, ph); + RB_REMOVE(phtree, &pp->pr_phtree, ph); if (pq) { LIST_INSERT_HEAD(pq, ph, ph_pagelist); } else { @@ -355,7 +355,7 @@ pool_init(struct pool *pp, size_t size, u_int align, u_int ioff, int flags, /* The page header will be taken from our page header pool */ pp->pr_phoffset = 0; off = palloc->pa_pagesz; - SPLAY_INIT(&pp->pr_phtree); + RB_INIT(&pp->pr_phtree); } /* @@ -846,7 +846,7 @@ pool_prime_page(struct pool *pp, caddr_t storage, struct pool_item_header *ph) ph->ph_pagesize = pp->pr_alloc->pa_pagesz; ph->ph_nmissing = 0; if ((pp->pr_roflags & PR_PHINPAGE) == 0) - SPLAY_INSERT(phtree, &pp->pr_phtree, ph); + RB_INSERT(phtree, &pp->pr_phtree, ph); pp->pr_nidle++; diff --git a/sys/sys/pool.h b/sys/sys/pool.h index f05d1b26c3e..77ff2533526 100644 --- a/sys/sys/pool.h +++ b/sys/sys/pool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pool.h,v 1.31 2008/12/23 06:54:12 dlg Exp $ */ +/* $OpenBSD: pool.h,v 1.32 2009/08/09 13:41:03 thib Exp $ */ /* $NetBSD: pool.h,v 1.27 2001/06/06 22:00:17 rafal Exp $ */ /*- @@ -103,7 +103,7 @@ struct pool { int pr_ipl; - SPLAY_HEAD(phtree, pool_item_header) pr_phtree; + RB_HEAD(phtree, pool_item_header) pr_phtree; int pr_maxcolor; /* Cache colouring */ int pr_curcolor; |