Whamcloud - gitweb
LU-11390 quota: mark over-quota flag correctly 38/33238/7
authorHongchao Zhang <hongchao@whamcloud.com>
Sun, 14 Oct 2018 02:37:21 +0000 (22:37 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 13 Nov 2018 06:17:27 +0000 (06:17 +0000)
Currently, if the current granted quota space is less than or
equal to the usage + pending_write + waiting_write, the over-quota
flag will be marked and sent back to OSC, it will damage the write
performance drastically. this patch will compare the current pending
and the waiting space to the threshold of over-quota check, and the
threshold will be taken into account only if the remain margin quota
space is larger than the threshold.

Test-Parameters: mdtfilesystemtype=zfs ostfilesystemtype=zfs \
testlist=sanity-quota,sanity-quota,sanity-quota,sanity-quota,sanity-quota

Change-Id: I0ecd134c3119ec1d86dbaa6e668091a68b7f5f54
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33238
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qsd_handler.c

index eb0bddb..577e3cf 100644 (file)
@@ -784,10 +784,13 @@ out_flags:
                        __u64   usage;
 
                        lqe_read_lock(lqe);
-                       usage  = lqe->lqe_usage;
-                       usage += lqe->lqe_pending_write;
+                       usage = lqe->lqe_pending_write;
                        usage += lqe->lqe_waiting_write;
-                       usage += qqi->qqi_qsd->qsd_sync_threshold;
+                       if (lqe->lqe_qunit != 0 && (usage % lqe->lqe_qunit >
+                           qqi->qqi_qsd->qsd_sync_threshold))
+                               usage += qqi->qqi_qsd->qsd_sync_threshold;
+
+                       usage += lqe->lqe_usage;
 
                        qtype_flag = lquota_over_fl(qqi->qqi_qtype);
                        /* if we should notify client to start sync write */