Author: mjg
Date: Fri Jun  8 03:16:16 2018
New Revision: 334824
URL: https://svnweb.freebsd.org/changeset/base/334824

Log:
  uma: remove M_ZERO support for pcpu zones
  
  Nothing in the tree uses it and pcpu zones have a fundamentally different use
  case than the regular zones - they are not supposed to be allocated and freed
  all the time.
  
  This reduces pollution in the allocation fast path.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c      Fri Jun  8 02:03:51 2018        (r334823)
+++ head/sys/vm/uma_core.c      Fri Jun  8 03:16:16 2018        (r334824)
@@ -2256,6 +2256,8 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags
        }
        KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(),
            ("uma_zalloc_arg: called with spinlock or critical section held"));
+       if (zone->uz_flags & UMA_ZONE_PCPU)
+               MPASS((flags & M_ZERO) == 0);
 
 #ifdef DEBUG_MEMGUARD
        if (memguard_cmp_zone(zone)) {
@@ -3604,13 +3606,8 @@ uma_large_free(uma_slab_t slab)
 static void
 uma_zero_item(void *item, uma_zone_t zone)
 {
-       int i;
 
-       if (zone->uz_flags & UMA_ZONE_PCPU) {
-               CPU_FOREACH(i)
-                       bzero(zpcpu_get_cpu(item, i), zone->uz_size);
-       } else
-               bzero(item, zone->uz_size);
+       bzero(item, zone->uz_size);
 }
 
 unsigned long
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to