Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154962767
D27142.id79336.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27142.id79336.diff
View Options
Index: sys/kern/kern_malloc.c
===================================================================
--- sys/kern/kern_malloc.c
+++ sys/kern/kern_malloc.c
@@ -174,11 +174,6 @@
{0, NULL},
};
-/*
- * Zone to allocate per-CPU storage for statistics.
- */
-static uma_zone_t mt_stats_zone;
-
u_long vm_kmem_size;
SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0,
"Size of kernel memory");
@@ -1184,9 +1179,6 @@
if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX)
kmem_zmax = KMEM_ZMAX;
- mt_stats_zone = uma_zcreate("mt_stats_zone",
- sizeof(struct malloc_type_stats), NULL, NULL, NULL, NULL,
- UMA_ALIGN_PTR, UMA_ZONE_PCPU);
for (i = 0, indx = 0; kmemzones[indx].kz_size != 0; indx++) {
int size = kmemzones[indx].kz_size;
const char *name = kmemzones[indx].kz_name;
@@ -1222,7 +1214,7 @@
mtp->ks_shortdesc, mtp->ks_version);
mtip = &mtp->ks_mti;
- mtip->mti_stats = uma_zalloc_pcpu(mt_stats_zone, M_WAITOK | M_ZERO);
+ mtip->mti_stats = uma_zalloc_pcpu(pcpu_zone_64, M_WAITOK | M_ZERO);
mtp_set_subzone(mtp);
mtx_lock(&malloc_mtx);
@@ -1279,7 +1271,7 @@
temp_allocs, temp_bytes);
}
- uma_zfree_pcpu(mt_stats_zone, mtip->mti_stats);
+ uma_zfree_pcpu(pcpu_zone_64, mtip->mti_stats);
}
struct malloc_type *
Index: sys/sys/malloc.h
===================================================================
--- sys/sys/malloc.h
+++ sys/sys/malloc.h
@@ -92,6 +92,9 @@
uint64_t _mts_reserved3; /* Reserved field. */
};
+_Static_assert(sizeof(struct malloc_type_stats) == 64,
+ "allocations come from pcpu_zone_64");
+
/*
* Index definitions for the mti_probes[] array.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 8:33 AM (12 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32566263
Default Alt Text
D27142.id79336.diff (1 KB)
Attached To
Mode
D27142: malloc: retire mt_stats_zone in favor of pcpu_zone_64
Attached
Detach File
Event Timeline
Log In to Comment