@@ -24,6 +24,15 @@ static lookasidelist_stats_t lookasidelist_stats = {
2424 { "chunk_size" , KSTAT_DATA_UINT64 },
2525};
2626
27+ #ifdef _KERNEL
28+ extern uint64_t stat_osif_malloc_success ;
29+ extern uint64_t stat_osif_free ;
30+ extern uint64_t stat_osif_malloc_bytes ;
31+ extern uint64_t stat_osif_free_bytes ;
32+ extern uint64_t segkmem_total_mem_allocated ;
33+ #endif
34+
35+
2736static int
2837lookaside_kstat_update (kstat_t * ksp , int rw )
2938{
@@ -153,20 +162,24 @@ lookasidelist_cache_destroy(lookasidelist_cache_t *pLookasidelist_cache)
153162
154163void *
155164lookasidelist_cache_alloc (lookasidelist_cache_t * pLookasidelist_cache )
156- {
157- void * buf = ExAllocateFromLookasideListEx (
165+ {
166+ void * buf = ExAllocateFromLookasideListEx (
158167 & pLookasidelist_cache -> lookasideField );
159168
160- if (buf == NULL )
161- {
162- buf = ExAllocatePoolWithTagPriority (NonPagedPoolNx , pLookasidelist_cache -> cache_chunksize , '!SFZ' , HighPoolPriority );
169+ if (buf == NULL ) {
170+
171+ buf = ExAllocatePoolWithTagPriority (NonPagedPoolNx , pLookasidelist_cache -> cache_chunksize , ZFS_LookAsideList_DRV_TAG , HighPoolPriority );
163172 if (buf != NULL )
164173 {
165- atomic_inc_64 (pLookasidelist_cache -> cache_active_allocations );
166- atomic_inc_64 (pLookasidelist_cache -> total_alloc );
167- }
168- }
174+ atomic_inc_64 (& stat_osif_malloc_success );
175+ atomic_add_64 (& segkmem_total_mem_allocated , pLookasidelist_cache -> cache_chunksize );
176+ atomic_add_64 (& stat_osif_malloc_bytes , pLookasidelist_cache -> cache_chunksize );
169177
178+ atomic_inc_64 (& pLookasidelist_cache -> cache_active_allocations );
179+ atomic_inc_64 (& pLookasidelist_cache -> total_alloc );
180+ }
181+ }
182+
170183 ASSERT (buf != NULL );
171184 return (buf );
172185}
0 commit comments