Unverified Commit f6a805ea authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11386 v5 support block hierarchy stats

Merge Pull Request from: @ci-robot 
 
PR sync from: Yu Kuai <yukuai3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/WZHTLHS7AOWN5MXW33FR5TBCLTF7GV3G/ 
Changes in v5:
 - add missing callers of blk_rq_hierarchy_stats_complete() in patch 16;
 - remove blk_mq_debugfs_unregister_hierarchy_stats in patch 16;
 - use NR_NEW_STAT_GROUPS in patch 18;

Changes in v4:
 - remove changes to cfq in patch 2, also fix kabi change for blk-wbt in
 patch 2;
 - check q->mq_ops from the only caller from blk-flush.c in patch 12;

Changes in v3:
 - fix patch 7 format;

Changes in v2:
 - find_get_pid(current->pid); -> get_pid(task_pid(current));
 - check q->mq_ops in blk_mq_get_alloc_task();
 - remove blk_mq_debugfs_unregister_hierarchy_stats();
 - include cgroup_path() inside CONFIG_BLK_CGROUP;

Bart Van Assche (1):
  blk-mq: remove blk_mq_put_ctx()

Jens Axboe (4):
  block: add blk_time_get_ns() and blk_time_get() helpers
  block: cache current nsec time in struct blk_plug
  block: update cached timestamp post schedule/preemption
  block: limit block time caching to in_task() context

Yu Kuai (25):
  blk-mq: export blk-mq-debugfs apis
  block: fix that blk_time_get_ns() doesn't update time after schedule
  block: fix kabi broken in struct blk_plug
  block: support to recored bio allocation time
  block: support to recored bio allocation task
  block: support to recored bio allocation time in request
  block: fix kabi broken for struct request
  block: support to recored bio allocation task in request
  block: block: fix kabi broken for struct blk_mq_alloc_data
  blk-mq-debugfs: factor out a new helper to show allocated request
  block: support to record when request is completed
  block-io-hierarchy: core hierarchy stats implementation
  block-io-hierarchy: core hierarchy iodump implementation
  blk-io-hierarchy: support to recored the number of slow IO
  blk-io-hierarchy: support new bio based stage blk-throtl
  blk-io-hierarchy: support new bio based stage blk-wbt
  blk-io-hierarchy: support new bio based stage gettag
  blk-io-hierarchy: support new rq based stage plug
  blk-io-hierarchy: support new rq based stage mq-deadline
  blk-io-hierarchy: support new rq based stage bfq
  blk-io-hierarchy: support new rq based stage kyber
  blk-io-hierarchy: support new rq based stage hctx
  blk-io-hierarchy: support new rq based stage requeue
  blk-io-hierarchy: support new rq based stage rq_driver
  blk-io-hierarchy: support new stage for bio lifetime


-- 
2.39.2
 
https://gitee.com/openeuler/kernel/issues/IAGRKP 
 
Link:https://gitee.com/openeuler/kernel/pulls/11386

 

Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parents d8f790ae ac91631e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -822,6 +822,7 @@ CONFIG_BLK_DEBUG_FS=y
CONFIG_BLK_DEBUG_FS_ZONED=y
# CONFIG_BLK_SED_OPAL is not set
# CONFIG_BLK_BIO_DISPATCH_ASYNC is not set
# CONFIG_BLK_IO_HIERARCHY_STATS is not set

#
# Partition Types
+1 −0
Original line number Diff line number Diff line
@@ -891,6 +891,7 @@ CONFIG_BLK_WBT_MQ=y
CONFIG_BLK_DEBUG_FS=y
# CONFIG_BLK_SED_OPAL is not set
# CONFIG_BLK_BIO_DISPATCH_ASYNC is not set
# CONFIG_BLK_IO_HIERARCHY_STATS is not set

#
# Partition Types
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,12 @@ menuconfig BLOCK

if BLOCK

config BLK_BIO_ALLOC_TIME
	bool

config BLK_BIO_ALLOC_TASK
	bool

config LBDAF
	bool "Support for large (2TB+) block devices and files"
	depends on !64BIT
@@ -213,6 +219,8 @@ config BLK_BIO_DISPATCH_ASYNC
	feature will require special care in the driver to work. If unsure,
	say N here.

source "block/blk-io-hierarchy/Kconfig"

menu "Partition Types"

source "block/partitions/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -37,3 +37,4 @@ obj-$(CONFIG_BLK_WBT) += blk-wbt.o
obj-$(CONFIG_BLK_DEBUG_FS)	+= blk-mq-debugfs.o
obj-$(CONFIG_BLK_DEBUG_FS_ZONED)+= blk-mq-debugfs-zoned.o
obj-$(CONFIG_BLK_SED_OPAL)	+= sed-opal.o
obj-$(CONFIG_BLK_IO_HIERARCHY_STATS)    += blk-io-hierarchy/
+8 −7
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/sbitmap.h>
#include <linux/delay.h>

#include "blk.h"
#include "bfq-iosched.h"

#if defined(CONFIG_BFQ_GROUP_IOSCHED) &&  defined(CONFIG_DEBUG_BLK_CGROUP)
@@ -60,7 +61,7 @@ static void bfqg_stats_update_group_wait_time(struct bfqg_stats *stats)
	if (!bfqg_stats_waiting(stats))
		return;

	now = ktime_get_ns();
	now = blk_time_get_ns();
	if (now > stats->start_group_wait_time)
		blkg_stat_add(&stats->group_wait_time,
			      now - stats->start_group_wait_time);
@@ -77,7 +78,7 @@ static void bfqg_stats_set_start_group_wait_time(struct bfq_group *bfqg,
		return;
	if (bfqg == curr_bfqg)
		return;
	stats->start_group_wait_time = ktime_get_ns();
	stats->start_group_wait_time = blk_time_get_ns();
	bfqg_stats_mark_waiting(stats);
}

@@ -89,7 +90,7 @@ static void bfqg_stats_end_empty_time(struct bfqg_stats *stats)
	if (!bfqg_stats_empty(stats))
		return;

	now = ktime_get_ns();
	now = blk_time_get_ns();
	if (now > stats->start_empty_time)
		blkg_stat_add(&stats->empty_time,
			      now - stats->start_empty_time);
@@ -116,7 +117,7 @@ void bfqg_stats_set_start_empty_time(struct bfq_group *bfqg)
	if (bfqg_stats_empty(stats))
		return;

	stats->start_empty_time = ktime_get_ns();
	stats->start_empty_time = blk_time_get_ns();
	bfqg_stats_mark_empty(stats);
}

@@ -125,7 +126,7 @@ void bfqg_stats_update_idle_time(struct bfq_group *bfqg)
	struct bfqg_stats *stats = &bfqg->stats;

	if (bfqg_stats_idling(stats)) {
		u64 now = ktime_get_ns();
		u64 now = blk_time_get_ns();

		if (now > stats->start_idle_time)
			blkg_stat_add(&stats->idle_time,
@@ -138,7 +139,7 @@ void bfqg_stats_set_start_idle_time(struct bfq_group *bfqg)
{
	struct bfqg_stats *stats = &bfqg->stats;

	stats->start_idle_time = ktime_get_ns();
	stats->start_idle_time = blk_time_get_ns();
	bfqg_stats_mark_idling(stats);
}

@@ -175,7 +176,7 @@ void bfqg_stats_update_completion(struct bfq_group *bfqg, u64 start_time_ns,
				  u64 io_start_time_ns, unsigned int op)
{
	struct bfqg_stats *stats = &bfqg->stats;
	u64 now = ktime_get_ns();
	u64 now = blk_time_get_ns();

	if (now > io_start_time_ns)
		blkg_rwstat_add(&stats->service_time, op,
Loading