From 61c3391acc988573aaf9e59550f863de4affcb68 Mon Sep 17 00:00:00 2001 From: Serapheim Dimitropoulos Date: Sun, 13 Jan 2019 10:09:46 -0800 Subject: Serialize ZTHR operations to eliminate races Adds a new lock for serializing operations on zthrs. The commit also includes some code cleanup and refactoring. Reviewed by: Matt Ahrens Reviewed by: Tom Caputi Reviewed-by: Brian Behlendorf Signed-off-by: Serapheim Dimitropoulos Closes #8229 --- module/zfs/arc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'module/zfs/arc.c') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 9e0ffd06d..7e0963334 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -5113,7 +5113,7 @@ arc_adjust_cb_check(void *arg, zthr_t *zthr) * from the ARC. */ /* ARGSUSED */ -static int +static void arc_adjust_cb(void *arg, zthr_t *zthr) { uint64_t evicted = 0; @@ -5147,8 +5147,6 @@ arc_adjust_cb(void *arg, zthr_t *zthr) } mutex_exit(&arc_adjust_lock); spl_fstrans_unmark(cookie); - - return (0); } /* ARGSUSED */ @@ -5190,7 +5188,7 @@ arc_reap_cb_check(void *arg, zthr_t *zthr) * to free more buffers. */ /* ARGSUSED */ -static int +static void arc_reap_cb(void *arg, zthr_t *zthr) { int64_t free_memory; @@ -5231,8 +5229,6 @@ arc_reap_cb(void *arg, zthr_t *zthr) arc_reduce_target_size(to_free); } spl_fstrans_unmark(cookie); - - return (0); } #ifdef _KERNEL -- cgit v1.2.3