hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGRKP CVE: NA
--------------------------------
A new config BLK_BIO_ALLOC_TIME is added to control the behaviour, and the time will be used later for blk-io-hierarchy. Also fix the problem that split BIO is not tracked if CONFIG_EULEROS_BLK_IO_TIME is enabeld.
Signed-off-by: Yu Kuai yukuai3@huawei.com --- block/Kconfig | 3 +++ block/bio.c | 4 ++++ include/linux/blk_types.h | 4 ++++ 3 files changed, 11 insertions(+)
diff --git a/block/Kconfig b/block/Kconfig index da71e56f8682..de3574766ef5 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -26,6 +26,9 @@ menuconfig BLOCK
if BLOCK
+config BLK_BIO_ALLOC_TIME + bool + config LBDAF bool "Support for large (2TB+) block devices and files" depends on !64BIT diff --git a/block/bio.c b/block/bio.c index 06193e854577..200d17093a8e 100644 --- a/block/bio.c +++ b/block/bio.c @@ -285,6 +285,10 @@ void bio_init(struct bio *bio, struct bio_vec *table,
bio->bi_io_vec = table; bio->bi_max_vecs = max_vecs; + +#ifdef CONFIG_BLK_BIO_ALLOC_TIME + bio->bi_alloc_time_ns = blk_time_get_ns(); +#endif } EXPORT_SYMBOL(bio_init);
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 8075b9955bb3..efafee166996 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -203,7 +203,11 @@ struct bio {
struct bio_set *bi_pool;
+#if defined(CONFIG_BLK_BIO_ALLOC_TIME) && !defined(__GENKSYMS__) + u64 bi_alloc_time_ns; +#else KABI_RESERVE(1) +#endif KABI_RESERVE(2) KABI_RESERVE(3)