Whamcloud - gitweb
LU-7988 hsm: wake up cdt when requests are empty 42/29742/4
authorBen Evans <bevans@cray.com>
Tue, 24 Oct 2017 15:34:06 +0000 (11:34 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 6 Nov 2017 03:42:54 +0000 (03:42 +0000)
The coordinator only runs once per second, we need a mechanism
to send more work when everything is done (cdt_request_count
goes to zero)

Without this, there is a hard limit of max_requests per sec
requests that can be processed, causing performance issues
with small files.

Signed-off-by: Ben Evans <bevans@cray.com>
Change-Id: I563666a1a3e53f0ec5908de593de71ff4d925467
Reviewed-on: https://review.whamcloud.com/29742
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sergey Cheremencev <cherementsev@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_hsm_cdt_requests.c
lustre/mdt/mdt_internal.h

index 1372c42..d369a5d 100644 (file)
@@ -570,9 +570,11 @@ static int mdt_coordinator(void *data)
                 * repeatedly locking/unlocking the catalog for each request
                 * and preventing other HSM operations from happening */
                wait_event_interruptible_timeout(cdt->cdt_waitq,
-                                                kthread_should_stop(),
+                                                kthread_should_stop() ||
+                                                cdt->cdt_wakeup_coordinator,
                                                 wait_event_time);
 
+               cdt->cdt_wakeup_coordinator = false;
                CDEBUG(D_HSM, "coordinator resumes\n");
 
                if (kthread_should_stop()) {
index 4ab3db1..a07cb7c 100644 (file)
@@ -431,7 +431,11 @@ int mdt_cdt_remove_request(struct coordinator *cdt, __u64 cookie)
        mdt_cdt_put_request(car);
 
        LASSERT(atomic_read(&cdt->cdt_request_count) >= 1);
-       atomic_dec(&cdt->cdt_request_count);
+       if (atomic_dec_and_test(&cdt->cdt_request_count)) {
+               /* request count is empty, nudge coordinator for more work */
+               cdt->cdt_wakeup_coordinator = true;
+               wake_up_interruptible(&cdt->cdt_waitq);
+       }
 
        RETURN(0);
 }
index 23c993c..2000374 100644 (file)
@@ -179,6 +179,8 @@ struct coordinator {
 
        /* Remove archive on last unlink policy */
        bool                     cdt_remove_archive_on_last_unlink;
+
+       bool                     cdt_wakeup_coordinator;
 };
 
 /* mdt state flag bits */