From: Alex Zhuravlev Date: Thu, 20 Sep 2018 07:47:03 +0000 (+0300) Subject: LU-11408 osc: propagate grant shrink interval immediately X-Git-Tag: 2.12.53~109 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F33204%2F2;p=fs%2Flustre-release.git LU-11408 osc: propagate grant shrink interval immediately 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 Reviewed-on: https://review.whamcloud.com/33204 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 727e930..7b776f7 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -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; } diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index 62b5c2b..fbb933f 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -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, diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 52120fb..994201e 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -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. */