aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJerome Marchand <jmarchan@redhat.com>2009-04-22 08:01:49 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-24 02:54:21 -0400
commit42dad7647aec49b3ad20dd0cb832b232a6ae514f (patch)
treeb70d4cb7706f2647e65426e24f078ddf14d6e139 /include/linux
parent097102c2d04974bdfcfa16a5f3062d499842139c (diff)
block: simplify I/O stat accounting
This simplifies I/O stat accounting switching code and separates it completely from I/O scheduler switch code. Requests are accounted according to the state of their request queue at the time of the request allocation. There is no need anymore to flush the request queue when switching I/O accounting state. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ba54c834a59..2755d5c6da2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -118,6 +118,7 @@ enum rq_flag_bits {
118 __REQ_COPY_USER, /* contains copies of user pages */ 118 __REQ_COPY_USER, /* contains copies of user pages */
119 __REQ_INTEGRITY, /* integrity metadata has been remapped */ 119 __REQ_INTEGRITY, /* integrity metadata has been remapped */
120 __REQ_NOIDLE, /* Don't anticipate more IO after this one */ 120 __REQ_NOIDLE, /* Don't anticipate more IO after this one */
121 __REQ_IO_STAT, /* account I/O stat */
121 __REQ_NR_BITS, /* stops here */ 122 __REQ_NR_BITS, /* stops here */
122}; 123};
123 124
@@ -145,6 +146,7 @@ enum rq_flag_bits {
145#define REQ_COPY_USER (1 << __REQ_COPY_USER) 146#define REQ_COPY_USER (1 << __REQ_COPY_USER)
146#define REQ_INTEGRITY (1 << __REQ_INTEGRITY) 147#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
147#define REQ_NOIDLE (1 << __REQ_NOIDLE) 148#define REQ_NOIDLE (1 << __REQ_NOIDLE)
149#define REQ_IO_STAT (1 << __REQ_IO_STAT)
148 150
149#define BLK_MAX_CDB 16 151#define BLK_MAX_CDB 16
150 152
@@ -598,6 +600,7 @@ enum {
598 blk_failfast_transport(rq) || \ 600 blk_failfast_transport(rq) || \
599 blk_failfast_driver(rq)) 601 blk_failfast_driver(rq))
600#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) 602#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
603#define blk_rq_io_stat(rq) ((rq)->cmd_flags & REQ_IO_STAT)
601 604
602#define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) 605#define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq)))
603 606