History

block: Add flag for telling the IO schedulers NOT to anticipate more IO

By default, CFQ will anticipate more IO from a given io context if the previously completed IO was sync. This used to be fine, since the only sync IO was reads and O_DIRECT writes. But with more "normal" sync writes being used now, we don't want to anticipate for those. Add a bio/request flag that informs the IO scheduler that this is a sync request that we should not idle for. Introduce WRITE_ODIRECT specifically for O_DIRECT writes, and make sure that the other sync writes set this flag.

Jens Axboe committed 17 years ago

Commit aeb6faf1 parent 644b2d96 files · +25 −14Browse files

Showing the changes to include/linux/blkdev.h (1 of 6 files). Show all

Unified · Split

include/linux/blkdev.h+3−0
@@ -118,6 +118,7 @@ enum rq_flag_bits { · 117 unmodified lines
118118 __REQ_COPY_USER, /* contains copies of user pages */
119119 __REQ_INTEGRITY, /* integrity metadata has been remapped */
120120 __REQ_UNPLUG, /* unplug queue on submission */
121+ __REQ_NOIDLE, /* Don't anticipate more IO after this one */
121122 __REQ_NR_BITS, /* stops here */
122123 };
123124
@@ -145,6 +146,7 @@ enum rq_flag_bits { · 21 unmodified lines
145146 #define REQ_COPY_USER (1 << __REQ_COPY_USER)
146147 #define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
147148 #define REQ_UNPLUG (1 << __REQ_UNPLUG)
149+#define REQ_NOIDLE (1 << __REQ_NOIDLE)
148150
149151 #define BLK_MAX_CDB 16
150152
@@ -633,6 +635,7 @@ static inline bool rq_is_sync(struct request *rq) · 482 unmodified lines
633635 }
634636
635637 #define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META)
638+#define rq_noidle(rq) ((rq)->cmd_flags & REQ_NOIDLE)
636639
637640 static inline int blk_queue_full(struct request_queue *q, int sync)
638641 {