Print this page
XXXX kmem: remove a check that's always false
It's been a very long time since this code ran on systems with less than
24MB RAM.


4318             kmem_alloc_table, KMEM_MAXBUF, KMEM_ALIGN_SHIFT);
4319 
4320         kmem_alloc_caches_create(
4321             kmem_big_alloc_sizes, sizeof (kmem_big_alloc_sizes) / sizeof (int),
4322             kmem_big_alloc_table, maxbuf, KMEM_BIG_SHIFT);
4323 
4324         kmem_big_alloc_table_max = maxbuf >> KMEM_BIG_SHIFT;
4325 }
4326 
4327 void
4328 kmem_init(void)
4329 {
4330         kmem_cache_t *cp;
4331         int old_kmem_flags = kmem_flags;
4332         int use_large_pages = 0;
4333         size_t maxverify, minfirewall;
4334 
4335         kstat_init();
4336 
4337         /*
4338          * Small-memory systems (< 24 MB) can't handle kmem_flags overhead.
4339          */
4340         if (physmem < btop(24 << 20) && !(old_kmem_flags & KMF_STICKY))
4341                 kmem_flags = 0;
4342 
4343         /*
4344          * Don't do firewalled allocations if the heap is less than 1TB
4345          * (i.e. on a 32-bit kernel)
4346          * The resulting VM_NEXTFIT allocations would create too much
4347          * fragmentation in a small heap.
4348          */
4349 #if defined(_LP64)
4350         maxverify = minfirewall = PAGESIZE / 2;
4351 #else
4352         maxverify = minfirewall = ULONG_MAX;
4353 #endif
4354 
4355         /* LINTED */
4356         ASSERT(sizeof (kmem_cpu_cache_t) == KMEM_CPU_CACHE_SIZE);
4357 
4358         list_create(&kmem_caches, sizeof (kmem_cache_t),
4359             offsetof(kmem_cache_t, cache_link));
4360 
4361         kmem_metadata_arena = vmem_create("kmem_metadata", NULL, 0, PAGESIZE,
4362             vmem_alloc, vmem_free, heap_arena, 8 * PAGESIZE,
4363             VM_SLEEP | VMC_NO_QCACHE);




4318             kmem_alloc_table, KMEM_MAXBUF, KMEM_ALIGN_SHIFT);
4319 
4320         kmem_alloc_caches_create(
4321             kmem_big_alloc_sizes, sizeof (kmem_big_alloc_sizes) / sizeof (int),
4322             kmem_big_alloc_table, maxbuf, KMEM_BIG_SHIFT);
4323 
4324         kmem_big_alloc_table_max = maxbuf >> KMEM_BIG_SHIFT;
4325 }
4326 
4327 void
4328 kmem_init(void)
4329 {
4330         kmem_cache_t *cp;
4331         int old_kmem_flags = kmem_flags;
4332         int use_large_pages = 0;
4333         size_t maxverify, minfirewall;
4334 
4335         kstat_init();
4336 
4337         /*






4338          * Don't do firewalled allocations if the heap is less than 1TB
4339          * (i.e. on a 32-bit kernel)
4340          * The resulting VM_NEXTFIT allocations would create too much
4341          * fragmentation in a small heap.
4342          */
4343 #if defined(_LP64)
4344         maxverify = minfirewall = PAGESIZE / 2;
4345 #else
4346         maxverify = minfirewall = ULONG_MAX;
4347 #endif
4348 
4349         /* LINTED */
4350         ASSERT(sizeof (kmem_cpu_cache_t) == KMEM_CPU_CACHE_SIZE);
4351 
4352         list_create(&kmem_caches, sizeof (kmem_cache_t),
4353             offsetof(kmem_cache_t, cache_link));
4354 
4355         kmem_metadata_arena = vmem_create("kmem_metadata", NULL, 0, PAGESIZE,
4356             vmem_alloc, vmem_free, heap_arena, 8 * PAGESIZE,
4357             VM_SLEEP | VMC_NO_QCACHE);