diff options
author | Omar Sandoval <osandov@fb.com> | 2018-05-09 05:08:50 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-09 10:33:05 -0400 |
commit | 544ccc8dc904db55d4576c27a1eb66a888ffacea (patch) | |
tree | 5fa92e3cf1a5d33eddc61dfd65d088dd5cdb6f84 /include/linux/blkdev.h | |
parent | 5238dcf4136fd7287be8e7d38752645bfa5782ec (diff) |
block: get rid of struct blk_issue_stat
struct blk_issue_stat squashes three things into one u64:
- The time the driver started working on a request
- The original size of the request (for the io.low controller)
- Flags for writeback throttling
It turns out that on x86_64, we have a 4 byte hole in struct request
which we can fill with the non-timestamp fields from blk_issue_stat,
simplifying things quite a bit.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5c4eee043191..f2c2fc011e6b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -206,8 +206,18 @@ struct request { | |||
206 | struct gendisk *rq_disk; | 206 | struct gendisk *rq_disk; |
207 | struct hd_struct *part; | 207 | struct hd_struct *part; |
208 | unsigned long start_time; | 208 | unsigned long start_time; |
209 | struct blk_issue_stat issue_stat; | 209 | /* Time that I/O was submitted to the device. */ |
210 | /* Number of scatter-gather DMA addr+len pairs after | 210 | u64 io_start_time_ns; |
211 | |||
212 | #ifdef CONFIG_BLK_WBT | ||
213 | unsigned short wbt_flags; | ||
214 | #endif | ||
215 | #ifdef CONFIG_BLK_DEV_THROTTLING_LOW | ||
216 | unsigned short throtl_size; | ||
217 | #endif | ||
218 | |||
219 | /* | ||
220 | * Number of scatter-gather DMA addr+len pairs after | ||
211 | * physical address coalescing is performed. | 221 | * physical address coalescing is performed. |
212 | */ | 222 | */ |
213 | unsigned short nr_phys_segments; | 223 | unsigned short nr_phys_segments; |
@@ -267,8 +277,8 @@ struct request { | |||
267 | 277 | ||
268 | #ifdef CONFIG_BLK_CGROUP | 278 | #ifdef CONFIG_BLK_CGROUP |
269 | struct request_list *rl; /* rl this rq is alloced from */ | 279 | struct request_list *rl; /* rl this rq is alloced from */ |
270 | unsigned long long start_time_ns; | 280 | unsigned long long cgroup_start_time_ns; |
271 | unsigned long long io_start_time_ns; /* when passed to hardware */ | 281 | unsigned long long cgroup_io_start_time_ns; /* when passed to hardware */ |
272 | #endif | 282 | #endif |
273 | }; | 283 | }; |
274 | 284 | ||
@@ -1797,25 +1807,25 @@ int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned lo | |||
1797 | static inline void set_start_time_ns(struct request *req) | 1807 | static inline void set_start_time_ns(struct request *req) |
1798 | { | 1808 | { |
1799 | preempt_disable(); | 1809 | preempt_disable(); |
1800 | req->start_time_ns = sched_clock(); | 1810 | req->cgroup_start_time_ns = sched_clock(); |
1801 | preempt_enable(); | 1811 | preempt_enable(); |
1802 | } | 1812 | } |
1803 | 1813 | ||
1804 | static inline void set_io_start_time_ns(struct request *req) | 1814 | static inline void set_io_start_time_ns(struct request *req) |
1805 | { | 1815 | { |
1806 | preempt_disable(); | 1816 | preempt_disable(); |
1807 | req->io_start_time_ns = sched_clock(); | 1817 | req->cgroup_io_start_time_ns = sched_clock(); |
1808 | preempt_enable(); | 1818 | preempt_enable(); |
1809 | } | 1819 | } |
1810 | 1820 | ||
1811 | static inline uint64_t rq_start_time_ns(struct request *req) | 1821 | static inline uint64_t rq_start_time_ns(struct request *req) |
1812 | { | 1822 | { |
1813 | return req->start_time_ns; | 1823 | return req->cgroup_start_time_ns; |
1814 | } | 1824 | } |
1815 | 1825 | ||
1816 | static inline uint64_t rq_io_start_time_ns(struct request *req) | 1826 | static inline uint64_t rq_io_start_time_ns(struct request *req) |
1817 | { | 1827 | { |
1818 | return req->io_start_time_ns; | 1828 | return req->cgroup_io_start_time_ns; |
1819 | } | 1829 | } |
1820 | #else | 1830 | #else |
1821 | static inline void set_start_time_ns(struct request *req) {} | 1831 | static inline void set_start_time_ns(struct request *req) {} |