equal
deleted
inserted
replaced
145 */ |
145 */ |
146 static int arc_min_prefetch_lifespan; |
146 static int arc_min_prefetch_lifespan; |
147 |
147 |
148 static kmutex_t arc_reclaim_lock; |
148 static kmutex_t arc_reclaim_lock; |
149 static int arc_dead; |
149 static int arc_dead; |
|
150 |
|
151 /* |
|
152 * These tunables are for performance analysis. |
|
153 */ |
|
154 uint64_t zfs_arc_max; |
|
155 uint64_t zfs_arc_min; |
150 |
156 |
151 /* |
157 /* |
152 * Note that buffers can be on one of 5 states: |
158 * Note that buffers can be on one of 5 states: |
153 * ARC_anon - anonymous (discussed below) |
159 * ARC_anon - anonymous (discussed below) |
154 * ARC_mru - recently used, currently cached |
160 * ARC_mru - recently used, currently cached |
2427 if (arc.c * 8 >= 1<<30) |
2433 if (arc.c * 8 >= 1<<30) |
2428 arc.c_max = (arc.c * 8) - (1<<30); |
2434 arc.c_max = (arc.c * 8) - (1<<30); |
2429 else |
2435 else |
2430 arc.c_max = arc.c_min; |
2436 arc.c_max = arc.c_min; |
2431 arc.c_max = MAX(arc.c * 6, arc.c_max); |
2437 arc.c_max = MAX(arc.c * 6, arc.c_max); |
|
2438 |
|
2439 /* |
|
2440 * Allow the tunables to override our calculations if they are |
|
2441 * reasonable (ie. over 64MB) |
|
2442 */ |
|
2443 if (zfs_arc_max > 64<<20 && zfs_arc_max < physmem * PAGESIZE) |
|
2444 arc.c_max = zfs_arc_max; |
|
2445 if (zfs_arc_min > 64<<20 && zfs_arc_min <= arc.c_max) |
|
2446 arc.c_min = zfs_arc_min; |
|
2447 |
2432 arc.c = arc.c_max; |
2448 arc.c = arc.c_max; |
2433 arc.p = (arc.c >> 1); |
2449 arc.p = (arc.c >> 1); |
2434 |
2450 |
2435 /* if kmem_flags are set, lets try to use less memory */ |
2451 /* if kmem_flags are set, lets try to use less memory */ |
2436 if (kmem_debugging()) |
2452 if (kmem_debugging()) |