Date: Sun, 1 Apr 2018 04:47:05 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331862 - head/sys/vm Message-ID: <201804010447.w314l5oV061722@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Sun Apr 1 04:47:05 2018 New Revision: 331862 URL: https://svnweb.freebsd.org/changeset/base/331862 Log: Add the flag ZONE_NOBUCKETCACHE. This flag instructions UMA not to keep a cache of fully populated buckets. This will be used in a follow-on commit. The flag idea was originally from markj. Reviewed by: markj, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Apr 1 04:11:38 2018 (r331861) +++ head/sys/vm/uma.h Sun Apr 1 04:47:05 2018 (r331862) @@ -286,6 +286,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * NUMA aware Zone. Implements a best * effort first-touch policy. */ +#define UMA_ZONE_NOBUCKETCACHE 0x20000 /* + * Don't cache full buckets. Limit + * UMA to per-cpu state. + */ /* * These flags are shared between the keg and zone. In zones wishing to add Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Apr 1 04:11:38 2018 (r331861) +++ head/sys/vm/uma_core.c Sun Apr 1 04:47:05 2018 (r331862) @@ -2965,7 +2965,13 @@ zfree_start: /* ub_cnt is pointing to the last free item */ KASSERT(bucket->ub_cnt != 0, ("uma_zfree: Attempting to insert an empty bucket onto the full list.\n")); - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + goto zfree_restart; + } else + LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804010447.w314l5oV061722>