Import latest ARC change from OpenSolaris:

- large ghost eviction causes high write latency
- arc_adjust might adjust MRU unnecessarily
- arc_adapt can lead to wild arc_p adjustment

OpenSolaris onnv-revision:	12636:13b5d698941e

Submitted by:	avg
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6950219, 6953403, 6951024)
MFC after:	1 month
This commit is contained in:
Martin Matuska 2010-06-17 22:47:44 +00:00
parent b7a4702bd1
commit d3cf8f4b68

View File

@ -1949,8 +1949,9 @@ arc_adjust(void)
* Adjust MRU size
*/
adjustment = MIN(arc_size - arc_c,
arc_anon->arcs_size + arc_mru->arcs_size + arc_meta_used - arc_p);
adjustment = MIN((int64_t)(arc_size - arc_c),
(int64_t)(arc_anon->arcs_size + arc_mru->arcs_size + arc_meta_used -
arc_p));
if (adjustment > 0 && arc_mru->arcs_lsize[ARC_BUFC_DATA] > 0) {
delta = MIN(arc_mru->arcs_lsize[ARC_BUFC_DATA], adjustment);
@ -2271,10 +2272,7 @@ arc_reclaim_thread(void *dummy __unused)
arc_no_grow = FALSE;
}
if (needfree ||
(2 * arc_c < arc_size +
arc_mru_ghost->arcs_size + arc_mfu_ghost->arcs_size))
arc_adjust();
arc_adjust();
if (arc_eviction_list != NULL)
arc_do_user_evicts();
@ -2325,6 +2323,7 @@ arc_adapt(int bytes, arc_state_t *state)
if (state == arc_mru_ghost) {
mult = ((arc_mru_ghost->arcs_size >= arc_mfu_ghost->arcs_size) ?
1 : (arc_mfu_ghost->arcs_size/arc_mru_ghost->arcs_size));
mult = MIN(mult, 10); /* avoid wild arc_p adjustment */
arc_p = MIN(arc_c - arc_p_min, arc_p + bytes * mult);
} else if (state == arc_mfu_ghost) {
@ -2332,6 +2331,7 @@ arc_adapt(int bytes, arc_state_t *state)
mult = ((arc_mfu_ghost->arcs_size >= arc_mru_ghost->arcs_size) ?
1 : (arc_mru_ghost->arcs_size/arc_mfu_ghost->arcs_size));
mult = MIN(mult, 10);
delta = MIN(bytes * mult, arc_p);
arc_p = MAX(arc_p_min, arc_p - delta);