@@ -1426,7 +1426,6 @@ static void osc_consume_write_grant(struct client_obd *cli,
pga->flag |= OBD_BRW_FROM_GRANT;
CDEBUG(D_CACHE, "using %lu grant credits for brw %p page %p\n",
PAGE_SIZE, pga, pga->pg);
- osc_update_next_shrink(cli);
}
/* the companion to osc_consume_write_grant, called when a brw has completed.
@@ -354,6 +354,11 @@ int osc_io_commit_async(const struct lu_env *env,
pagevec_reinit(pvec);
}
}
+ /* The shrink interval is in seconds, so we can update it once per
+ * write, rather than once per page.
+ */
+ osc_update_next_shrink(osc_cli(osc));
+
/* Clean up any partially full pagevecs */
if (pagevec_count(pvec) != 0)