diff options
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 2 | ||||
-rw-r--r-- | sys/vm/uma.h | 11 | ||||
-rw-r--r-- | sys/vm/uma_core.c | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 7b7e5d1..46f49d2 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1746,6 +1746,8 @@ retry: if (swap == NULL) { mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); + if (uma_zone_exhausted(swap_zone)) + printf("swap zone exhausted, increase kern.maxswzone\n"); VM_WAIT; VM_OBJECT_LOCK(object); goto retry; diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 2181ec7..08a55d6 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -509,6 +509,17 @@ void uma_prealloc(uma_zone_t zone, int itemcnt); u_int32_t *uma_find_refcnt(uma_zone_t zone, void *item); /* + * Used to determine if a fixed-size zone is exhausted. + * + * Arguments: + * zone The zone to check + * + * Returns: + * Non-zero if zone is exhausted. + */ +int uma_zone_exhausted(uma_zone_t zone); + +/* * Exported statistics structures to be used by user space monitoring tools. * Statistics stream consusts of a uma_stream_header, followed by a series of * alternative uma_type_header and uma_type_stat structures. Statistics diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 3e8bb2e..ac3ffc4 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -2681,6 +2681,18 @@ uma_reclaim(void) bucket_zone_drain(); } +/* See uma.h */ +int +uma_zone_exhausted(uma_zone_t zone) +{ + int full; + + ZONE_LOCK(zone); + full = (zone->uz_keg->uk_flags & UMA_ZFLAG_FULL); + ZONE_UNLOCK(zone); + return (full); +} + void * uma_large_malloc(int size, int wait) { |