summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authormohans <mohans@FreeBSD.org>2007-01-25 01:05:23 +0000
committermohans <mohans@FreeBSD.org>2007-01-25 01:05:23 +0000
commit83064ec323555287e3f57d6a7467f4f3017aacbf (patch)
tree29d5e3c67fe7103c5fe9363f82111c4d5203c0f7 /sys/vm
parenta6abba5b5e0e902b8ffef521a7ae00fe2efdc14a (diff)
downloadFreeBSD-src-83064ec323555287e3f57d6a7467f4f3017aacbf.zip
FreeBSD-src-83064ec323555287e3f57d6a7467f4f3017aacbf.tar.gz
Fix for problems that occur when all mbuf clusters migrate to the mbuf packet
zone. Cluster allocations fail when this happens. Also processes that may have blocked on cluster allocations will never be woken up. Thanks to rwatson for an overview of the issue and pointers to the mbuma paper and his tool to dump out UMA zones. Reviewed by: andre@
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma.h3
-rw-r--r--sys/vm/uma_core.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h
index 08a55d6..0027177 100644
--- a/sys/vm/uma.h
+++ b/sys/vm/uma.h
@@ -48,6 +48,8 @@ struct uma_zone;
/* Opaque type used as a handle to the zone */
typedef struct uma_zone * uma_zone_t;
+void zone_drain(uma_zone_t);
+
/*
* Item constructor
*
@@ -518,6 +520,7 @@ u_int32_t *uma_find_refcnt(uma_zone_t zone, void *item);
* Non-zero if zone is exhausted.
*/
int uma_zone_exhausted(uma_zone_t zone);
+int uma_zone_exhausted_nolock(uma_zone_t zone);
/*
* Exported statistics structures to be used by user space monitoring tools.
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 62e7aff..fa2cb05 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -238,7 +238,6 @@ static void bucket_zone_drain(void);
static int uma_zalloc_bucket(uma_zone_t zone, int flags);
static uma_slab_t uma_zone_slab(uma_zone_t zone, int flags);
static void *uma_slab_alloc(uma_zone_t zone, uma_slab_t slab);
-static void zone_drain(uma_zone_t);
static uma_zone_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit,
uma_fini fini, int align, u_int32_t flags);
@@ -680,7 +679,7 @@ bucket_cache_drain(uma_zone_t zone)
* Returns:
* Nothing.
*/
-static void
+void
zone_drain(uma_zone_t zone)
{
struct slabhead freeslabs = { 0 };
@@ -2679,6 +2678,12 @@ uma_zone_exhausted(uma_zone_t zone)
return (full);
}
+int
+uma_zone_exhausted_nolock(uma_zone_t zone)
+{
+ return (zone->uz_keg->uk_flags & UMA_ZFLAG_FULL);
+}
+
void *
uma_large_malloc(int size, int wait)
{
OpenPOWER on IntegriCloud