Skip to content

Commit

Permalink
Revert "Allow arc_evict_ghost() to only evict meta data"
Browse files Browse the repository at this point in the history
This reverts commit 68121a0.

Conflicts:
	module/zfs/arc.c
  • Loading branch information
dweeezil committed Mar 1, 2015
1 parent ba5ac5c commit 730d690
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,7 @@ static arc_buf_hdr_t arc_eviction_hdr;
static void arc_get_data_buf(arc_buf_t *buf);
static void arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock);
static int arc_evict_needed(arc_buf_contents_t type);
static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes,
arc_buf_contents_t type);
static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes);
static void arc_buf_watch(arc_buf_t *buf);

static boolean_t l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *ab);
Expand Down Expand Up @@ -1939,7 +1938,6 @@ arc_evict(arc_state_t *state, uint64_t spa, int64_t bytes, boolean_t recycle,
* that evicting from the ghost list in this hot code path, leave
* this chore to the arc_reclaim_thread().
*/

return (stolen);
}

Expand All @@ -1948,12 +1946,11 @@ arc_evict(arc_state_t *state, uint64_t spa, int64_t bytes, boolean_t recycle,
* bytes. Destroy the buffers that are removed.
*/
static void
arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes,
arc_buf_contents_t type)
arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes)
{
arc_buf_hdr_t *ab, *ab_prev;
arc_buf_hdr_t marker;
list_t *list = &state->arcs_list[type];
list_t *list = &state->arcs_list[ARC_BUFC_DATA];
kmutex_t *hash_lock;
uint64_t bytes_deleted = 0;
uint64_t bufs_skipped = 0;
Expand Down Expand Up @@ -2088,15 +2085,15 @@ arc_adjust(void)

if (adjustment > 0 && arc_mru_ghost->arcs_size > 0) {
delta = MIN(arc_mru_ghost->arcs_size, adjustment);
arc_evict_ghost(arc_mru_ghost, 0, delta, ARC_BUFC_DATA);
arc_evict_ghost(arc_mru_ghost, 0, delta);
}

adjustment =
arc_mru_ghost->arcs_size + arc_mfu_ghost->arcs_size - arc_c;

if (adjustment > 0 && arc_mfu_ghost->arcs_size > 0) {
delta = MIN(arc_mfu_ghost->arcs_size, adjustment);
arc_evict_ghost(arc_mfu_ghost, 0, delta, ARC_BUFC_DATA);
arc_evict_ghost(arc_mfu_ghost, 0, delta);
}
}

Expand Down Expand Up @@ -2212,7 +2209,7 @@ arc_adjust_meta(void)
if (adjustmnt > 0 && arc_mru_ghost->arcs_lsize[ARC_BUFC_METADATA] > 0) {
delta = MIN(adjustmnt,
arc_mru_ghost->arcs_lsize[ARC_BUFC_METADATA]);
arc_evict_ghost(arc_mru_ghost, 0, delta, ARC_BUFC_METADATA);
arc_evict_ghost(arc_mru_ghost, 0, delta);
}

adjustmnt = arc_mru_ghost->arcs_lsize[ARC_BUFC_METADATA] +
Expand All @@ -2221,7 +2218,7 @@ arc_adjust_meta(void)
if (adjustmnt > 0 && arc_mfu_ghost->arcs_lsize[ARC_BUFC_METADATA] > 0) {
delta = MIN(adjustmnt,
arc_mfu_ghost->arcs_lsize[ARC_BUFC_METADATA]);
arc_evict_ghost(arc_mfu_ghost, 0, delta, ARC_BUFC_METADATA);
arc_evict_ghost(arc_mfu_ghost, 0, delta);
}

if (arc_meta_used > arc_meta_limit)
Expand Down Expand Up @@ -2261,8 +2258,8 @@ arc_flush(spa_t *spa)
break;
}

arc_evict_ghost(arc_mru_ghost, guid, -1, ARC_BUFC_DATA);
arc_evict_ghost(arc_mfu_ghost, guid, -1, ARC_BUFC_DATA);
arc_evict_ghost(arc_mru_ghost, guid, -1);
arc_evict_ghost(arc_mfu_ghost, guid, -1);

mutex_enter(&arc_reclaim_thr_lock);
arc_do_user_evicts();
Expand Down

0 comments on commit 730d690

Please sign in to comment.