Commit 6e6012df authored by Yu Kuai's avatar Yu Kuai
Browse files

block: support to recored bio allocation time

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/release-management/issues/IB4E8P


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.

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
parent fba98008
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ config BLOCK_LEGACY_AUTOLOAD
	  created on demand, but scripts that manually create device nodes and
	  then call losetup might rely on this behavior.

config BLK_BIO_ALLOC_TIME
	bool

config BLK_RQ_ALLOC_TIME
	bool

+4 −0
Original line number Diff line number Diff line
@@ -282,6 +282,10 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
	bio->bi_max_vecs = max_vecs;
	bio->bi_io_vec = table;
	bio->bi_pool = NULL;

#ifdef CONFIG_BLK_BIO_ALLOC_TIME
	bio->bi_alloc_time_ns = blk_time_get_ns();
#endif
}
EXPORT_SYMBOL(bio_init);

+4 −0
Original line number Diff line number Diff line
@@ -297,7 +297,11 @@ struct bio {
#endif
	KABI_RESERVE(2)
	KABI_RESERVE(3)
#ifdef CONFIG_BLK_BIO_ALLOC_TIME
	KABI_USE(4, u64 bi_alloc_time_ns)
#else
	KABI_RESERVE(4)
#endif
	KABI_RESERVE(5)
	KABI_RESERVE(6)
	KABI_RESERVE(7)