summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2010-06-17 22:47:44 +0000
committermm <mm@FreeBSD.org>2010-06-17 22:47:44 +0000
commit09f088a4573916eae591a58023d3ad0da1eff81d (patch)
tree7bbb4dd0463fc1752d34a2c14941681b6e0871dd /sys/cddl
parent4368976729a5a497f3676773a1e36b83d3405ea1 (diff)
downloadFreeBSD-src-09f088a4573916eae591a58023d3ad0da1eff81d.zip
FreeBSD-src-09f088a4573916eae591a58023d3ad0da1eff81d.tar.gz
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
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 5137d64..860b33c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -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);
OpenPOWER on IntegriCloud