Deleted Added
full compact
arc.c (321562) arc.c (321563)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6325 unchanged lines hidden (view full) ---

6334 cv_init(&arc_reclaim_waiters_cv, NULL, CV_DEFAULT, NULL);
6335
6336 mutex_init(&arc_dnlc_evicts_lock, NULL, MUTEX_DEFAULT, NULL);
6337 cv_init(&arc_dnlc_evicts_cv, NULL, CV_DEFAULT, NULL);
6338
6339 /* Convert seconds to clock ticks */
6340 arc_min_prefetch_lifespan = 1 * hz;
6341
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6325 unchanged lines hidden (view full) ---

6334 cv_init(&arc_reclaim_waiters_cv, NULL, CV_DEFAULT, NULL);
6335
6336 mutex_init(&arc_dnlc_evicts_lock, NULL, MUTEX_DEFAULT, NULL);
6337 cv_init(&arc_dnlc_evicts_cv, NULL, CV_DEFAULT, NULL);
6338
6339 /* Convert seconds to clock ticks */
6340 arc_min_prefetch_lifespan = 1 * hz;
6341
6342 /* Start out with 1/8 of all memory */
6343 arc_c = allmem / 8;
6344
6345#ifdef illumos
6346#ifdef _KERNEL
6347 /*
6348 * On architectures where the physical memory can be larger
6349 * than the addressable space (intel in 32-bit mode), we may
6350 * need to limit the cache to 1/8 of VM size.
6351 */
6352 arc_c = MIN(arc_c, vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 8);
6353#endif
6354#endif /* illumos */
6355 /* set min cache to 1/32 of all memory, or arc_abs_min, whichever is more */
6356 arc_c_min = MAX(allmem / 32, arc_abs_min);
6357 /* set max to 5/8 of all memory, or all but 1GB, whichever is more */
6358 if (allmem >= 1 << 30)
6359 arc_c_max = allmem - (1 << 30);
6360 else
6361 arc_c_max = arc_c_min;
6362 arc_c_max = MAX(allmem * 5 / 8, arc_c_max);

--- 23 unchanged lines hidden (view full) ---

6386
6387 arc_c = arc_c_max;
6388 arc_p = (arc_c >> 1);
6389 arc_size = 0;
6390
6391 /* limit meta-data to 1/4 of the arc capacity */
6392 arc_meta_limit = arc_c_max / 4;
6393
6342 /* set min cache to 1/32 of all memory, or arc_abs_min, whichever is more */
6343 arc_c_min = MAX(allmem / 32, arc_abs_min);
6344 /* set max to 5/8 of all memory, or all but 1GB, whichever is more */
6345 if (allmem >= 1 << 30)
6346 arc_c_max = allmem - (1 << 30);
6347 else
6348 arc_c_max = arc_c_min;
6349 arc_c_max = MAX(allmem * 5 / 8, arc_c_max);

--- 23 unchanged lines hidden (view full) ---

6373
6374 arc_c = arc_c_max;
6375 arc_p = (arc_c >> 1);
6376 arc_size = 0;
6377
6378 /* limit meta-data to 1/4 of the arc capacity */
6379 arc_meta_limit = arc_c_max / 4;
6380
6381#ifdef _KERNEL
6382 /*
6383 * Metadata is stored in the kernel's heap. Don't let us
6384 * use more than half the heap for the ARC.
6385 */
6386 arc_meta_limit = MIN(arc_meta_limit,
6387 vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 2);
6388#endif
6389
6394 /* Allow the tunable to override if it is reasonable */
6395 if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max)
6396 arc_meta_limit = zfs_arc_meta_limit;
6397
6398 if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0)
6399 arc_c_min = arc_meta_limit / 2;
6400
6401 if (zfs_arc_meta_min > 0) {

--- 1335 unchanged lines hidden ---
6390 /* Allow the tunable to override if it is reasonable */
6391 if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max)
6392 arc_meta_limit = zfs_arc_meta_limit;
6393
6394 if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0)
6395 arc_c_min = arc_meta_limit / 2;
6396
6397 if (zfs_arc_meta_min > 0) {

--- 1335 unchanged lines hidden ---