From 0b09a19bdf2db1c67635d86c7afbb8d3a90e351a Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 20 Sep 2018 10:47:03 +0300 Subject: [PATCH] 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 --- lustre/osc/lproc_osc.c | 2 ++ lustre/osc/osc_internal.h | 1 + lustre/osc/osc_request.c | 6 ++++++ 3 files changed, 9 insertions(+) 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. */ -- 1.8.3.1