Deleted Added
full compact
arc.c (252142) arc.c (252749)
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

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

284 kstat_named_t arcstat_mru_hits;
285 kstat_named_t arcstat_mru_ghost_hits;
286 kstat_named_t arcstat_mfu_hits;
287 kstat_named_t arcstat_mfu_ghost_hits;
288 kstat_named_t arcstat_allocated;
289 kstat_named_t arcstat_deleted;
290 kstat_named_t arcstat_stolen;
291 kstat_named_t arcstat_recycle_miss;
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

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

284 kstat_named_t arcstat_mru_hits;
285 kstat_named_t arcstat_mru_ghost_hits;
286 kstat_named_t arcstat_mfu_hits;
287 kstat_named_t arcstat_mfu_ghost_hits;
288 kstat_named_t arcstat_allocated;
289 kstat_named_t arcstat_deleted;
290 kstat_named_t arcstat_stolen;
291 kstat_named_t arcstat_recycle_miss;
292 /*
293 * Number of buffers that could not be evicted because the hash lock
294 * was held by another thread. The lock may not necessarily be held
295 * by something using the same buffer, since hash locks are shared
296 * by multiple buffers.
297 */
292 kstat_named_t arcstat_mutex_miss;
298 kstat_named_t arcstat_mutex_miss;
299 /*
300 * Number of buffers skipped because they have I/O in progress, are
301 * indrect prefetch buffers that have not lived long enough, or are
302 * not from the spa we're trying to evict from.
303 */
293 kstat_named_t arcstat_evict_skip;
294 kstat_named_t arcstat_evict_l2_cached;
295 kstat_named_t arcstat_evict_l2_eligible;
296 kstat_named_t arcstat_evict_l2_ineligible;
297 kstat_named_t arcstat_hash_elements;
298 kstat_named_t arcstat_hash_elements_max;
299 kstat_named_t arcstat_hash_collisions;
300 kstat_named_t arcstat_hash_chains;

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

3242 */
3243 if (vdev_is_dead(vd) ||
3244 !spa_config_tryenter(spa, SCL_L2ARC, vd, RW_READER))
3245 vd = NULL;
3246 }
3247
3248 mutex_exit(hash_lock);
3249
304 kstat_named_t arcstat_evict_skip;
305 kstat_named_t arcstat_evict_l2_cached;
306 kstat_named_t arcstat_evict_l2_eligible;
307 kstat_named_t arcstat_evict_l2_ineligible;
308 kstat_named_t arcstat_hash_elements;
309 kstat_named_t arcstat_hash_elements_max;
310 kstat_named_t arcstat_hash_collisions;
311 kstat_named_t arcstat_hash_chains;

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

3253 */
3254 if (vdev_is_dead(vd) ||
3255 !spa_config_tryenter(spa, SCL_L2ARC, vd, RW_READER))
3256 vd = NULL;
3257 }
3258
3259 mutex_exit(hash_lock);
3260
3261 /*
3262 * At this point, we have a level 1 cache miss. Try again in
3263 * L2ARC if possible.
3264 */
3250 ASSERT3U(hdr->b_size, ==, size);
3251 DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp,
3252 uint64_t, size, zbookmark_t *, zb);
3253 ARCSTAT_BUMP(arcstat_misses);
3254 ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH),
3255 demand, prefetch, hdr->b_type != ARC_BUFC_METADATA,
3256 data, metadata, misses);
3257#ifdef _KERNEL

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

3483 buf->b_private = NULL;
3484 buf->b_hdr = NULL;
3485 buf->b_next = NULL;
3486 kmem_cache_free(buf_cache, buf);
3487 return (1);
3488}
3489
3490/*
3265 ASSERT3U(hdr->b_size, ==, size);
3266 DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp,
3267 uint64_t, size, zbookmark_t *, zb);
3268 ARCSTAT_BUMP(arcstat_misses);
3269 ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH),
3270 demand, prefetch, hdr->b_type != ARC_BUFC_METADATA,
3271 data, metadata, misses);
3272#ifdef _KERNEL

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

3498 buf->b_private = NULL;
3499 buf->b_hdr = NULL;
3500 buf->b_next = NULL;
3501 kmem_cache_free(buf_cache, buf);
3502 return (1);
3503}
3504
3505/*
3491 * Release this buffer from the cache. This must be done
3492 * after a read and prior to modifying the buffer contents.
3506 * Release this buffer from the cache, making it an anonymous buffer. This
3507 * must be done after a read and prior to modifying the buffer contents.
3493 * If the buffer has more than one reference, we must make
3494 * a new hdr for the buffer.
3495 */
3496void
3497arc_release(arc_buf_t *buf, void *tag)
3498{
3499 arc_buf_hdr_t *hdr;
3500 kmutex_t *hash_lock = NULL;

--- 2012 unchanged lines hidden ---
3508 * If the buffer has more than one reference, we must make
3509 * a new hdr for the buffer.
3510 */
3511void
3512arc_release(arc_buf_t *buf, void *tag)
3513{
3514 arc_buf_hdr_t *hdr;
3515 kmutex_t *hash_lock = NULL;

--- 2012 unchanged lines hidden ---