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

!9770 Add a switch to enable hungtask check for io

Merge Pull Request from: @ci-robot 
 
PR sync from: Li Lingfeng <lilingfeng3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/TRSCLKRXWX4ZIK3Z2NJUHMLRYHP2OZ5Q/ 
Add a switch to enable hungtask check for io

Li Lingfeng (1):
  block: disable BLK_IO_HUNG_TASK_CHECK by default

Yu Kuai (1):
  block: add a switch to enable hungtask check for io


-- 
2.31.1
 
https://gitee.com/openeuler/kernel/issues/IAAQ73 
 
Link:https://gitee.com/openeuler/kernel/pulls/9770

 

Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents cbd751b4 fb15ae65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -949,6 +949,7 @@ CONFIG_BLK_DEBUG_FS_ZONED=y
# CONFIG_BLK_INLINE_ENCRYPTION is not set
CONFIG_BLK_DEV_DETECT_WRITING_PART0=y
CONFIG_BLK_DEV_WRITE_MOUNTED_DUMP=y
CONFIG_BLK_IO_HUNG_TASK_CHECK=n

#
# Partition Types
+1 −0
Original line number Diff line number Diff line
@@ -981,6 +981,7 @@ CONFIG_BLK_DEBUG_FS_ZONED=y
# CONFIG_BLK_INLINE_ENCRYPTION is not set
CONFIG_BLK_DEV_DETECT_WRITING_PART0=y
CONFIG_BLK_DEV_WRITE_MOUNTED_DUMP=y
CONFIG_BLK_IO_HUNG_TASK_CHECK=n

#
# Partition Types
+9 −0
Original line number Diff line number Diff line
@@ -266,6 +266,15 @@ config BLK_DEV_WRITE_MOUNTED_DUMP
	  Enabling this to dump info when opening mounted block devices
	  for write or trying to mount write opened block devices.

config BLK_IO_HUNG_TASK_CHECK
	bool "Enable io hung task check"
	depends on DETECT_HUNG_TASK
	default y
	help
	  Enabling this lets the block layer detect hungtask for io, noted
	  if this is set, hungtask will complain about slow io even if such
	  io is not hanged. Be careful to enable hungtask panic in this case.

source "block/partitions/Kconfig"

config BLK_MQ_PCI
+1 −1
Original line number Diff line number Diff line
@@ -1375,7 +1375,7 @@ int submit_bio_wait(struct bio *bio)
	submit_bio(bio);

	/* Prevent hang_check timer from firing at us during very long I/O */
	hang_check = sysctl_hung_task_timeout_secs;
	hang_check = sysctl_hung_task_timeout_secs && !io_hung_task_check;
	if (hang_check)
		while (!wait_for_completion_io_timeout(&done,
					hang_check * (HZ/2)))
+12 −1
Original line number Diff line number Diff line
@@ -86,6 +86,17 @@ static int __init precise_iostat_setup(char *str)
}
__setup("precise_iostat=", precise_iostat_setup);

/*
 * Noted if this is set, hungtask will complain about slow io even if such io is
 * not hanged. Be careful to enable hungtask panic in this case.
 */
#ifdef CONFIG_BLK_IO_HUNG_TASK_CHECK
bool io_hung_task_check = true;
#else
bool io_hung_task_check;
#endif
module_param_named(io_hung_task_check, io_hung_task_check, bool, 0644);

/**
 * blk_queue_flag_set - atomically set a queue flag
 * @flag: flag to be set
@@ -1205,7 +1216,7 @@ void blk_io_schedule(void)
	/* Prevent hang_check timer from firing at us during very long I/O */
	unsigned long timeout = sysctl_hung_task_timeout_secs * HZ / 2;

	if (timeout)
	if (timeout && !io_hung_task_check)
		io_schedule_timeout(timeout);
	else
		io_schedule();
Loading