Whamcloud - gitweb
LU-9339 quota: Replace MAXQUOTAS usage with LL_MAXQUOTAS
[fs/lustre-release.git] / lustre / quota / qmt_internal.h
index e21c78f..6b1892e 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  * Use is subject to license terms.
  */
 
@@ -116,18 +116,18 @@ struct qmt_pool_info {
 
        /* pointer to dt object associated with global indexes for both user
         * and group quota */
-       struct dt_object        *qpi_glb_obj[MAXQUOTAS];
+       struct dt_object        *qpi_glb_obj[LL_MAXQUOTAS];
 
        /* A pool supports two different quota types: user and group quota.
         * Each quota type has its own global index and lquota_entry hash table.
         */
-       struct lquota_site      *qpi_site[MAXQUOTAS];
+       struct lquota_site      *qpi_site[LL_MAXQUOTAS];
 
        /* number of slaves registered for each quota types */
-       int                      qpi_slv_nr[MAXQUOTAS];
+       int                      qpi_slv_nr[LL_MAXQUOTAS];
 
        /* reference on lqe (ID 0) storing grace time. */
-       struct lquota_entry     *qpi_grace_lqe[MAXQUOTAS];
+       struct lquota_entry     *qpi_grace_lqe[LL_MAXQUOTAS];
 
        /* procfs root directory for this pool */
        struct proc_dir_entry   *qpi_proc;
@@ -139,6 +139,22 @@ struct qmt_pool_info {
        /* Global quota parameters which apply to all quota type */
        /* the least value of qunit */
        unsigned long            qpi_least_qunit;
+
+       /* Least value of qunit when soft limit is exceeded.
+        *
+        * When soft limit is exceeded, qunit will be shrinked to least_qunit
+        * (1M for block limit), that results in significant write performance
+        * drop since the client will turn to sync write from now on.
+        *
+        * To retain the write performance in an acceptable level, we choose
+        * to sacrifice grace time accuracy a bit and use a larger least_qunit
+        * when soft limit is exceeded. It's (qpi_least_qunit * 4) by default,
+        * and user may enlarge it via procfs to get even better performance
+        * (with the cost of losing more grace time accuracy).
+        *
+        * See qmt_calc_softlimit().
+        */
+       unsigned long            qpi_soft_least_qunit;
 };
 
 /*