Whamcloud - gitweb
LU-15082 osp: invalidate statfs data from the timer callback 99/45199/11
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 12 Oct 2021 05:26:21 +0000 (08:26 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jun 2022 05:31:48 +0000 (05:31 +0000)
osp_statfs_timer_cb() can be called just before statfs data gets
stale. this in turn may cause early wakeup to the precreate thread
which would find statfs data still up-to-data and go back to slepp.
if no precreate happens to this OSP (e.g. due to current space
usage), then the precreate thread will stay asleep for a long time,
statfs data won't get refreshed and this may block new objects
on the corresponding OST.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I86e16eed6f1068702db696a9ddec7a22994180b7
Reviewed-on: https://review.whamcloud.com/45199
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_precreate.c

index 5585ce1..6fd6f7f 100644 (file)
@@ -81,6 +81,8 @@ static void osp_statfs_timer_cb(cfs_timer_cb_arg_t data)
        struct osp_device *d = cfs_from_timer(d, data, opd_statfs_timer);
 
        LASSERT(d);
+       /* invalidate statfs data so osp_precreate_thread() can refresh */
+       d->opd_statfs_fresh_till = ktime_sub_ns(ktime_get(), NSEC_PER_SEC);
        if (d->opd_pre_task)
                wake_up(&d->opd_pre_waitq);
 }