diff options
author | Josh Paetzel <jpaetzel@FreeBSD.org> | 2017-02-17 17:52:12 +0000 |
---|---|---|
committer | Josh Paetzel <jpaetzel@FreeBSD.org> | 2017-02-17 17:52:12 +0000 |
commit | aedc9253011f9ca50a98253ab72e0b6b18b2944d (patch) | |
tree | 1635d169e87e34516018715f471efcda9db0aa98 /sys/cddl | |
parent | cbebea4e67bdc7e49d729665390ed69e16f2e147 (diff) | |
parent | 91c038e77a05b9baf3048510b0dda424955dcc36 (diff) | |
download | src-aedc9253011f9ca50a98253ab72e0b6b18b2944d.tar.gz src-aedc9253011f9ca50a98253ab72e0b6b18b2944d.zip |
MVF: 313876
7504 kmem_reap hangs spa_sync and administrative tasks
illumos/illumos-gate@405a5a0f5c3ab36cb76559467d1a62ba648bd809
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80
https://www.illumos.org/issues/7504
We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.
Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Notes
Notes:
svn path=/head/; revision=313879
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 11 |
1 files changed, 8 insertions, 3 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 6f9892a3e36b..2a7801e2cc1a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -4086,7 +4086,6 @@ arc_reclaim_thread(void *dummy __unused) mutex_enter(&arc_reclaim_lock); while (!arc_reclaim_thread_exit) { - int64_t free_memory = arc_available_memory(); uint64_t evicted = 0; /* @@ -4105,6 +4104,14 @@ arc_reclaim_thread(void *dummy __unused) mutex_exit(&arc_reclaim_lock); + /* + * We call arc_adjust() before (possibly) calling + * arc_kmem_reap_now(), so that we can wake up + * arc_get_data_buf() sooner. + */ + evicted = arc_adjust(); + + int64_t free_memory = arc_available_memory(); if (free_memory < 0) { arc_no_grow = B_TRUE; @@ -4138,8 +4145,6 @@ arc_reclaim_thread(void *dummy __unused) arc_no_grow = B_FALSE; } - evicted = arc_adjust(); - mutex_enter(&arc_reclaim_lock); /* |