It was not clean which was not obvious until QA detected
significant drop in performance because small ioreqs
were accounted as 512k ones.

This patch goes together with "fs/fuse kio: remove unused flow detection code",
can be merged at the next port.

Signed-off-by: Alexey Kuznetsov <[email protected]>
---
 fs/fuse/kio/pcs/pcs_cs.c  |  2 --
 fs/fuse/kio/pcs/pcs_map.c | 25 ++++++-------------------
 fs/fuse/kio/pcs/pcs_req.h |  2 --
 3 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 275fc8b..73476f5 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -699,8 +699,6 @@ static void do_cs_submit(struct pcs_cs *cs, struct 
pcs_int_request *ireq)
                ioh->fiemap_count = PCS_FIEMAP_CHUNK_COUNT;
        memset(&ioh->sync, 0, sizeof(ioh->sync));
 
-       if (ireq->flags & IREQ_F_SEQ)
-               ioh->sync.misc = PCS_CS_IO_SEQ;
        if (ireq->dentry->no_csum_on_read)
                 ioh->sync.misc |= PCS_CS_IO_NOCSUM;
        if ((ireq->dentry->fileinfo.attr.attrib & PCS_FATTR_IMMEDIATE_WRITE) || 
ireq->dentry->no_write_delay)
diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index 3e2a00b..915b074 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -1474,7 +1474,7 @@ static void pcs_cs_deaccount(struct pcs_int_request 
*ireq, struct pcs_cs * cs, i
                        ireq->iochunk.cmd == PCS_REQ_T_FIEMAP)
                        cost = PCS_CS_HOLE_WEIGHT;
                else
-                       cost = (ireq->flags & IREQ_F_RND_WEIGHT) ? 512*1024 : 
cong_roundup(ireq->iochunk.size);
+                       cost = cong_roundup(ireq->iochunk.size);
        } else
                cost = PCS_CS_FLUSH_WEIGHT;
 
@@ -1877,11 +1877,8 @@ static int select_cs_for_read(struct pcs_cluster_core 
*cc, struct pcs_cs_list *
        else if (io_locality == 0 && local_mask != local_busy_mask) {
                selected = local_idx;
                io_cost = local_min / 16;
-       } else if (get_io_tweaks(cc) & PCS_TWEAK_IGNORE_SEQUENTIAL)
-               selected = remote_idx;
-       else {
+       } else
                selected = remote_idx;
-       }
 
        /* Add penalty. The result of current decision will reflect itself in 
latency
         * after at least one round-trip time. Penalty poisons weight until 
that moment.
@@ -2061,15 +2058,10 @@ static int pcs_cslist_submit_read(struct 
pcs_int_request *ireq, struct pcs_cs_li
                        }
                }
 
-               sreq->flags &= ~(IREQ_F_RND_WEIGHT | IREQ_F_SEQ);
-               if (ireq->iochunk.cmd != PCS_REQ_T_READ) {
+               if (ireq->iochunk.cmd != PCS_REQ_T_READ)
                        weight = PCS_CS_HOLE_WEIGHT;
-               } else if (sreq->iochunk.size >= 512*1024) {
+               else
                        weight = cong_roundup(sreq->iochunk.size);
-               } else {
-                       sreq->flags |= IREQ_F_RND_WEIGHT;
-                       weight = 512*1024;
-               }
 
                cs_increment_in_flight(cs, weight);
                allot -= weight;
@@ -2226,15 +2218,10 @@ static int pcs_cslist_submit_write(struct 
pcs_int_request *ireq, struct pcs_cs_l
                        }
                }
 
-               sreq->flags &= ~(IREQ_F_RND_WEIGHT | IREQ_F_SEQ);
-               if (ireq->iochunk.cmd != PCS_REQ_T_WRITE) {
+               if (ireq->iochunk.cmd != PCS_REQ_T_WRITE)
                        weight = PCS_CS_HOLE_WEIGHT;
-               } else if (sreq->iochunk.size > 512*1024) {
+               else
                        weight = cong_roundup(sreq->iochunk.size);
-               } else {
-                       weight = 512*1024;
-                       sreq->flags |= IREQ_F_RND_WEIGHT;
-               }
 
                for (i = 0; i < csl->nsrv; i++)
                        cs_increment_in_flight(csl->cs[i].cslink.cs, weight);
diff --git a/fs/fuse/kio/pcs/pcs_req.h b/fs/fuse/kio/pcs/pcs_req.h
index 00af53a..a8c9c9b 100644
--- a/fs/fuse/kio/pcs/pcs_req.h
+++ b/fs/fuse/kio/pcs/pcs_req.h
@@ -114,9 +114,7 @@ struct pcs_int_request
        int                     flags;
 #define IREQ_F_FATAL           1
 #define IREQ_F_ONCE            2
-#define IREQ_F_RND_WEIGHT      8
 #define IREQ_F_CACHED          0x10
-#define IREQ_F_SEQ             0x20
 #define IREQ_F_MAPPED          0x40
 #define IREQ_F_MAP_REQUIRED    0x80
 #define IREQ_F_LOC_TOKEN       0x100
-- 
1.8.3.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to