@@ -667,9 +667,10 @@ static inline void cfqg_put(struct cfq_group *cfqg)
667
667
} while (0)
668
668
669
669
static inline void cfqg_stats_update_io_add (struct cfq_group * cfqg ,
670
- struct cfq_group * curr_cfqg , int rw )
670
+ struct cfq_group * curr_cfqg , int op ,
671
+ int op_flags )
671
672
{
672
- blkg_rwstat_add (& cfqg -> stats .queued , rw , 1 );
673
+ blkg_rwstat_add (& cfqg -> stats .queued , op , op_flags , 1 );
673
674
cfqg_stats_end_empty_time (& cfqg -> stats );
674
675
cfqg_stats_set_start_group_wait_time (cfqg , curr_cfqg );
675
676
}
@@ -683,26 +684,30 @@ static inline void cfqg_stats_update_timeslice_used(struct cfq_group *cfqg,
683
684
#endif
684
685
}
685
686
686
- static inline void cfqg_stats_update_io_remove (struct cfq_group * cfqg , int rw )
687
+ static inline void cfqg_stats_update_io_remove (struct cfq_group * cfqg , int op ,
688
+ int op_flags )
687
689
{
688
- blkg_rwstat_add (& cfqg -> stats .queued , rw , -1 );
690
+ blkg_rwstat_add (& cfqg -> stats .queued , op , op_flags , -1 );
689
691
}
690
692
691
- static inline void cfqg_stats_update_io_merged (struct cfq_group * cfqg , int rw )
693
+ static inline void cfqg_stats_update_io_merged (struct cfq_group * cfqg , int op ,
694
+ int op_flags )
692
695
{
693
- blkg_rwstat_add (& cfqg -> stats .merged , rw , 1 );
696
+ blkg_rwstat_add (& cfqg -> stats .merged , op , op_flags , 1 );
694
697
}
695
698
696
699
static inline void cfqg_stats_update_completion (struct cfq_group * cfqg ,
697
- uint64_t start_time , uint64_t io_start_time , int rw )
700
+ uint64_t start_time , uint64_t io_start_time , int op ,
701
+ int op_flags )
698
702
{
699
703
struct cfqg_stats * stats = & cfqg -> stats ;
700
704
unsigned long long now = sched_clock ();
701
705
702
706
if (time_after64 (now , io_start_time ))
703
- blkg_rwstat_add (& stats -> service_time , rw , now - io_start_time );
707
+ blkg_rwstat_add (& stats -> service_time , op , op_flags ,
708
+ now - io_start_time );
704
709
if (time_after64 (io_start_time , start_time ))
705
- blkg_rwstat_add (& stats -> wait_time , rw ,
710
+ blkg_rwstat_add (& stats -> wait_time , op , op_flags ,
706
711
io_start_time - start_time );
707
712
}
708
713
@@ -781,13 +786,16 @@ static inline void cfqg_put(struct cfq_group *cfqg) { }
781
786
#define cfq_log_cfqg (cfqd , cfqg , fmt , args ...) do {} while (0)
782
787
783
788
static inline void cfqg_stats_update_io_add (struct cfq_group * cfqg ,
784
- struct cfq_group * curr_cfqg , int rw ) { }
789
+ struct cfq_group * curr_cfqg , int op , int op_flags ) { }
785
790
static inline void cfqg_stats_update_timeslice_used (struct cfq_group * cfqg ,
786
791
unsigned long time , unsigned long unaccounted_time ) { }
787
- static inline void cfqg_stats_update_io_remove (struct cfq_group * cfqg , int rw ) { }
788
- static inline void cfqg_stats_update_io_merged (struct cfq_group * cfqg , int rw ) { }
792
+ static inline void cfqg_stats_update_io_remove (struct cfq_group * cfqg , int op ,
793
+ int op_flags ) { }
794
+ static inline void cfqg_stats_update_io_merged (struct cfq_group * cfqg , int op ,
795
+ int op_flags ) { }
789
796
static inline void cfqg_stats_update_completion (struct cfq_group * cfqg ,
790
- uint64_t start_time , uint64_t io_start_time , int rw ) { }
797
+ uint64_t start_time , uint64_t io_start_time , int op ,
798
+ int op_flags ) { }
791
799
792
800
#endif /* CONFIG_CFQ_GROUP_IOSCHED */
793
801
@@ -2461,10 +2469,10 @@ static void cfq_reposition_rq_rb(struct cfq_queue *cfqq, struct request *rq)
2461
2469
{
2462
2470
elv_rb_del (& cfqq -> sort_list , rq );
2463
2471
cfqq -> queued [rq_is_sync (rq )]-- ;
2464
- cfqg_stats_update_io_remove (RQ_CFQG (rq ), rq -> cmd_flags );
2472
+ cfqg_stats_update_io_remove (RQ_CFQG (rq ), req_op ( rq ), rq -> cmd_flags );
2465
2473
cfq_add_rq_rb (rq );
2466
2474
cfqg_stats_update_io_add (RQ_CFQG (rq ), cfqq -> cfqd -> serving_group ,
2467
- rq -> cmd_flags );
2475
+ req_op ( rq ), rq -> cmd_flags );
2468
2476
}
2469
2477
2470
2478
static struct request *
@@ -2517,7 +2525,7 @@ static void cfq_remove_request(struct request *rq)
2517
2525
cfq_del_rq_rb (rq );
2518
2526
2519
2527
cfqq -> cfqd -> rq_queued -- ;
2520
- cfqg_stats_update_io_remove (RQ_CFQG (rq ), rq -> cmd_flags );
2528
+ cfqg_stats_update_io_remove (RQ_CFQG (rq ), req_op ( rq ), rq -> cmd_flags );
2521
2529
if (rq -> cmd_flags & REQ_PRIO ) {
2522
2530
WARN_ON (!cfqq -> prio_pending );
2523
2531
cfqq -> prio_pending -- ;
@@ -2552,7 +2560,7 @@ static void cfq_merged_request(struct request_queue *q, struct request *req,
2552
2560
static void cfq_bio_merged (struct request_queue * q , struct request * req ,
2553
2561
struct bio * bio )
2554
2562
{
2555
- cfqg_stats_update_io_merged (RQ_CFQG (req ), bio -> bi_rw );
2563
+ cfqg_stats_update_io_merged (RQ_CFQG (req ), bio_op ( bio ), bio -> bi_rw );
2556
2564
}
2557
2565
2558
2566
static void
@@ -2575,7 +2583,7 @@ cfq_merged_requests(struct request_queue *q, struct request *rq,
2575
2583
if (cfqq -> next_rq == next )
2576
2584
cfqq -> next_rq = rq ;
2577
2585
cfq_remove_request (next );
2578
- cfqg_stats_update_io_merged (RQ_CFQG (rq ), next -> cmd_flags );
2586
+ cfqg_stats_update_io_merged (RQ_CFQG (rq ), req_op ( next ), next -> cmd_flags );
2579
2587
2580
2588
cfqq = RQ_CFQQ (next );
2581
2589
/*
@@ -4108,7 +4116,7 @@ static void cfq_insert_request(struct request_queue *q, struct request *rq)
4108
4116
rq -> fifo_time = jiffies + cfqd -> cfq_fifo_expire [rq_is_sync (rq )];
4109
4117
list_add_tail (& rq -> queuelist , & cfqq -> fifo );
4110
4118
cfq_add_rq_rb (rq );
4111
- cfqg_stats_update_io_add (RQ_CFQG (rq ), cfqd -> serving_group ,
4119
+ cfqg_stats_update_io_add (RQ_CFQG (rq ), cfqd -> serving_group , req_op ( rq ),
4112
4120
rq -> cmd_flags );
4113
4121
cfq_rq_enqueued (cfqd , cfqq , rq );
4114
4122
}
@@ -4206,7 +4214,8 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
4206
4214
cfqq -> dispatched -- ;
4207
4215
(RQ_CFQG (rq ))-> dispatched -- ;
4208
4216
cfqg_stats_update_completion (cfqq -> cfqg , rq_start_time_ns (rq ),
4209
- rq_io_start_time_ns (rq ), rq -> cmd_flags );
4217
+ rq_io_start_time_ns (rq ), req_op (rq ),
4218
+ rq -> cmd_flags );
4210
4219
4211
4220
cfqd -> rq_in_flight [cfq_cfqq_sync (cfqq )]-- ;
4212
4221
0 commit comments