diff options
author | George Melikov <[email protected]> | 2017-02-04 20:21:25 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-02-04 09:21:25 -0800 |
commit | 0a252daed3bafb71740ed37bd039bd421277bc82 (patch) | |
tree | eeb688bfe0ebf752d75636b36a2b732216545059 /module | |
parent | 2e0e443ac40c7e825a02519a497328226bd866ff (diff) |
OpenZFS 7504 - kmem_reap hangs spa_sync and administrative tasks
Authored by: Matthew Ahrens <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Prakash Surya <[email protected]>
Approved by: Dan McDonald <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tim Chase <[email protected]>
Ported-by: George Melikov <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/7504
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/405a5a0
Closes #5736
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/arc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 351e50e40..2a3913239 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4193,7 +4193,6 @@ arc_reclaim_thread(void) mutex_enter(&arc_reclaim_lock); while (!arc_reclaim_thread_exit) { int64_t to_free; - int64_t free_memory = arc_available_memory(); uint64_t evicted = 0; arc_tuning_update(); @@ -4215,6 +4214,14 @@ arc_reclaim_thread(void) #endif 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; @@ -4247,8 +4254,6 @@ arc_reclaim_thread(void) arc_no_grow = B_FALSE; } - evicted = arc_adjust(); - mutex_enter(&arc_reclaim_lock); /* |