block: fix revalidate performance regression
[platform/kernel/linux-starfive.git] / block / blk-iocost.c
index bfc33fa..00d59d2 100644 (file)
@@ -232,7 +232,9 @@ enum {
 
        /* 1/64k is granular enough and can easily be handled w/ u32 */
        WEIGHT_ONE              = 1 << 16,
+};
 
+enum {
        /*
         * As vtime is used to calculate the cost of each IO, it needs to
         * be fairly high precision.  For example, it should be able to
@@ -256,6 +258,11 @@ enum {
        VRATE_MIN               = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION,
        VRATE_CLAMP_ADJ_PCT     = 4,
 
+       /* switch iff the conditions are met for longer than this */
+       AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
+};
+
+enum {
        /* if IOs end up waiting for requests, issue less */
        RQ_WAIT_BUSY_PCT        = 5,
 
@@ -294,9 +301,6 @@ enum {
        /* don't let cmds which take a very long time pin lagging for too long */
        MAX_LAGGING_PERIODS     = 10,
 
-       /* switch iff the conditions are met for longer than this */
-       AUTOP_CYCLE_NSEC        = 10LLU * NSEC_PER_SEC,
-
        /*
         * Count IO size in 4k pages.  The 12bit shift helps keeping
         * size-proportional components of cost calculation in closer