Subject: Re: Initialising the same pool multiple times
To: None <tech-kern@netbsd.org>
From: Jed Davis <jdev@panix.com>
List: tech-kern
Date: 02/14/2006 00:24:31
Simon Burge <simonb@wasabisystems.com> writes:

> Hi folks,
>
> At the moment, it's possible to call pool_init() multiple times for
> same pool.  Currently, this corrupts the "all-pools" list such that
> "vmstat -m" will now endlessly loop.  The patch below panics if this
> happens when DIAGNOSTIC is enabled, and otherwise prints a warning
> then returns early..
>
> Is this the best way to handle this condition?  Should the warning be
> inside an "#ifdef DEBUG" check?

Check and panic on DIAGNOSTIC, ignore otherwise?  That's the usual for
"potentially expensive" consistency checks.  Or, if it's not considered
expensive -- isn't pool_init called once per pool per boot? -- assert
always.

-- 
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))