Whamcloud - gitweb
LU-11408 osc: propagate grant shrink interval immediately 04/33204/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 20 Sep 2018 07:47:03 +0000 (10:47 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 21 Mar 2019 03:42:54 +0000 (03:42 +0000)
currently the new interval (updated with lctl) will be used
only when the next shrink happens. with default interval it
will take at least 20 minutes. instead we should refresh it
immediately.

Change-Id: Id22824e48fbc50c1f464316ab5b574d1189bb0c5
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33204
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/lproc_osc.c
lustre/osc/osc_internal.h
lustre/osc/osc_request.c

index 727e930..7b776f7 100644 (file)
@@ -362,6 +362,8 @@ static ssize_t grant_shrink_interval_store(struct kobject *kobj,
                return -ERANGE;
 
        obd->u.cli.cl_grant_shrink_interval = val;
+       osc_update_next_shrink(&obd->u.cli);
+       osc_schedule_grant_work();
 
        return count;
 }
index 62b5c2b..fbb933f 100644 (file)
@@ -44,6 +44,7 @@ extern struct ptlrpc_request_pool *osc_rq_pool;
 
 void osc_wake_cache_waiters(struct client_obd *cli);
 int osc_shrink_grant_to_target(struct client_obd *cli, __u64 target_bytes);
+void osc_schedule_grant_work(void);
 void osc_update_next_shrink(struct client_obd *cli);
 int lru_queue_work(const struct lu_env *env, void *data);
 int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,
index 52120fb..994201e 100644 (file)
@@ -908,6 +908,12 @@ static void osc_grant_work_handler(struct work_struct *data)
                schedule_work(&work.work);
 }
 
+void osc_schedule_grant_work(void)
+{
+       cancel_delayed_work_sync(&work);
+       schedule_work(&work.work);
+}
+
 /**
  * Start grant thread for returing grant to server for idle clients.
  */