version 1.29, 1999/08/05 04:00:04 |
version 1.31, 2000/02/14 19:28:19 |
Line 449 pool_init(pp, size, align, ioff, flags, |
|
Line 449 pool_init(pp, size, align, ioff, flags, |
|
pp->pr_nout = 0; |
pp->pr_nout = 0; |
pp->pr_hardlimit = UINT_MAX; |
pp->pr_hardlimit = UINT_MAX; |
pp->pr_hardlimit_warning = NULL; |
pp->pr_hardlimit_warning = NULL; |
pp->pr_hardlimit_ratecap = 0; |
pp->pr_hardlimit_ratecap.tv_sec = 0; |
memset(&pp->pr_hardlimit_warning_last, 0, |
pp->pr_hardlimit_ratecap.tv_usec = 0; |
sizeof(pp->pr_hardlimit_warning_last)); |
pp->pr_hardlimit_warning_last.tv_sec = 0; |
|
pp->pr_hardlimit_warning_last.tv_usec = 0; |
|
|
/* |
/* |
* Decide whether to put the page header off page to avoid |
* Decide whether to put the page header off page to avoid |
Line 620 _pool_get(pp, flags, file, line) |
|
Line 621 _pool_get(pp, flags, file, line) |
|
pr_enter(pp, file, line); |
pr_enter(pp, file, line); |
goto startover; |
goto startover; |
} |
} |
if (pp->pr_hardlimit_warning != NULL) { |
|
/* |
/* |
* Log a message that the hard limit has been hit. |
* Log a message that the hard limit has been hit. |
*/ |
*/ |
struct timeval curtime, logdiff; |
if (pp->pr_hardlimit_warning != NULL && |
int s = splclock(); |
ratecheck(&pp->pr_hardlimit_warning_last, |
curtime = mono_time; |
&pp->pr_hardlimit_ratecap)) |
splx(s); |
log(LOG_ERR, "%s\n", pp->pr_hardlimit_warning); |
timersub(&curtime, &pp->pr_hardlimit_warning_last, |
|
&logdiff); |
|
if (logdiff.tv_sec >= pp->pr_hardlimit_ratecap) { |
|
pp->pr_hardlimit_warning_last = curtime; |
|
log(LOG_ERR, "%s\n", pp->pr_hardlimit_warning); |
|
} |
|
} |
|
|
|
if (flags & PR_URGENT) |
if (flags & PR_URGENT) |
panic("pool_get: urgent"); |
panic("pool_get: urgent"); |
Line 831 _pool_put(pp, v, file, line) |
|
Line 825 _pool_put(pp, v, file, line) |
|
simple_lock(&pp->pr_slock); |
simple_lock(&pp->pr_slock); |
pr_enter(pp, file, line); |
pr_enter(pp, file, line); |
|
|
|
#ifdef DIAGNOSTIC |
|
if (pp->pr_nout == 0) { |
|
printf("pool %s: putting with none out\n", |
|
pp->pr_wchan); |
|
panic("pool_put"); |
|
} |
|
#endif |
|
|
pr_log(pp, v, PRLOG_PUT, file, line); |
pr_log(pp, v, PRLOG_PUT, file, line); |
|
|
if ((ph = pr_find_pagehead(pp, page)) == NULL) { |
if ((ph = pr_find_pagehead(pp, page)) == NULL) { |
Line 1174 pool_sethardlimit(pp, n, warnmess, ratec |
|
Line 1176 pool_sethardlimit(pp, n, warnmess, ratec |
|
|
|
pp->pr_hardlimit = n; |
pp->pr_hardlimit = n; |
pp->pr_hardlimit_warning = warnmess; |
pp->pr_hardlimit_warning = warnmess; |
pp->pr_hardlimit_ratecap = ratecap; |
pp->pr_hardlimit_ratecap.tv_sec = ratecap; |
memset(&pp->pr_hardlimit_warning_last, 0, |
pp->pr_hardlimit_warning_last.tv_sec = 0; |
sizeof(pp->pr_hardlimit_warning_last)); |
pp->pr_hardlimit_warning_last.tv_usec = 0; |
|
|
/* |
/* |
* In-line version of pool_sethiwat(), because we don't want to |
* In-line version of pool_sethiwat(), because we don't want to |