--- uma_dbg.c.orig Mon Nov 7 23:05:09 2005 +++ uma_dbg.c Tue Nov 8 17:37:24 2005 @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include @@ -86,8 +88,33 @@ { int cnt; u_int32_t *p; + struct callout *c; + struct callout_tailq *bucket; + int i; cnt = size / sizeof(uma_junk); + + mtx_lock_spin(&callout_lock); + + for (i = 0; i < callwheelsize; ++i) { + bucket = &callwheel[i]; + for (c = TAILQ_FIRST(bucket); c != NULL; + c = TAILQ_NEXT(c, c_links.tqe)) { + int c2 = (int)c; + int mem2 = (int)mem; + if ((u_int32_t)c == uma_junk) { + kdb_enter("trash_dtor: uma_junk found in a "\ + "callwheel element"); + break; + } + if (c2 >= mem2 && c2 < mem2 + size) { + kdb_enter("trash_dtor: found invalid "\ + "callwhel element"); + } + } + } + + mtx_unlock_spin(&callout_lock); for (p = mem; cnt > 0; cnt--, p++) *p = uma_junk;