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>
__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 */