Go to file
Niklas Cassel 1159f42562 scsi: core: Kick the requeue list after inserting when flushing
When libata calls ata_link_abort() to abort all ata queued commands, it
calls blk_abort_request() on the SCSI command representing each QC.

This causes scsi_timeout() to be called, which calls scsi_eh_scmd_add() for
each SCSI command.

scsi_eh_scmd_add() sets the SCSI host to state recovery, and then adds the
command to shost->eh_cmd_q.

This will wake up the SCSI EH, and eventually the libata EH strategy
handler will be called, which calls scsi_eh_flush_done_q() to either flush
retry or flush finish each failed command.

The commands that are flush retried by scsi_eh_flush_done_q() are done so
using scsi_queue_insert().

Before commit 8b566edbdb ("scsi: core: Only kick the requeue list if
necessary"), __scsi_queue_insert() called blk_mq_requeue_request() with the
second argument set to true, indicating that it should always kick/run the
requeue list after inserting.

After commit 8b566edbdb ("scsi: core: Only kick the requeue list if
necessary"), __scsi_queue_insert() does not kick/run the requeue list after
inserting, if the current SCSI host state is recovery (which is the case in
the libata example above).

This optimization is probably fine in most cases, as I can only assume that
most often someone will eventually kick/run the queues.

However, that is not the case for scsi_eh_flush_done_q(), where we can see
that the request gets inserted to the requeue list, but the queue is never
started after the request has been inserted, leading to the block layer
waiting for the completion of command that never gets to run.

Since scsi_eh_flush_done_q() is called by SCSI EH context, the SCSI host
state is most likely always in recovery when this function is called.

Thus, let scsi_eh_flush_done_q() explicitly kick the requeue list after
inserting a flush retry command, so that scsi_eh_flush_done_q() keeps the
same behavior as before commit 8b566edbdb ("scsi: core: Only kick the
requeue list if necessary").

Simple reproducer for the libata example above:
$ hdparm -Y /dev/sda
$ echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/delete

Fixes: 8b566edbdb ("scsi: core: Only kick the requeue list if necessary")
Reported-by: Kevin Locke <kevin@kevinlocke.name>
Closes: https://lore.kernel.org/linux-scsi/ZZw3Th70wUUvCiCY@kevinlocke.name/
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20240111120533.3612509-1-cassel@kernel.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: chenyi <chenyi211@huawei.com>
2024-06-12 17:11:42 +08:00
Documentation ethtool: Extend link modes settings uAPI with lanes 2024-06-12 16:56:30 +08:00
LICENSES LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
arch tencent.config: arm64: default select CONFIG_PAGE_POOL_STATS 2024-06-12 13:17:56 +08:00
block tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
certs tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
crypto tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
dist dist: provide kernel version info in kernel*core*.rpm 2024-06-12 13:16:35 +08:00
drivers scsi: core: Kick the requeue list after inserting when flushing 2024-06-12 17:11:42 +08:00
fs tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
include net: phy: avoid kernel warning dump when stopping an errored PHY 2024-06-12 16:57:03 +08:00
init Kconfig: disable BT_SCHED and ZRAM_MEMCG 2024-06-12 13:16:36 +08:00
ipc tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
kernel tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
lib tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
mm mm/page_alloc: inline __rmqueue_pcplist 2024-06-12 13:16:56 +08:00
net ethtool: Expose the number of lanes in use 2024-06-12 16:56:49 +08:00
package tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
samples tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
scripts tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
security tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
sound tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
tools tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
usr tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
virt tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
.clang-format tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
.gitignore ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
.mailmap tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer 2019-10-10 08:12:51 -07:00
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
MAINTAINERS tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
Makefile tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00
README.md tkernel: sync code to the same with tk4 pub/lts/0017-kabi 2024-06-12 13:13:20 +08:00
backport_remove_lists.txt tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
tools_key.pub tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00

README.md

Tencent Linux Kernel 4.0

一、项目介绍 README

wiki空间
TK (TencentOS kernel)是腾讯OS团队自研的TencentOS内核将最新的Linux创新推向市场
为企业各类软件提供了超强性能、高可伸缩性和可靠性。

生命周期

TK4基于社区5.4 longterm2020年发布2025年12月31日停止维护。
image.png

  • 开发阶段:内核发布前的内部构建、准备、开发阶段。
  • 全面支持会持续开发、回合新特性、定期对其上游Bug Fix。
  • 扩展支持主要对齐上游bug fix patch以稳定运行为主。
    TK4各版本changelog信息

二、快速上手 Getting Started

1、config

本地编译前需要按照服务器类型准备好对应config文件服务器编译可以跳过该部分

  • 标准 X86 config路径
package/default/config.default   
  • 标准 ARM config路径
package/arm/config.default   

2、构建&安装镜像

  • 本地编译
make -j[x] # 编译   
make modules_install install # 安装  
  • Tmanger编译
    tmanger 在下拉菜单中选择对应仓库等会自动进行编译成功后会生成对应rpm压缩包。 执行如下指令安装
rpm -ivh *.rpm

头文件rpm包最好使用-Uvh方式安装


三、常见问题

详细各模块问题: 常见问题总结

  • TK现网问题负责人
    tlinux_helperfrankjpliu, shookliusamuelliaoalexsshi。
  • 如何查看内核版本
uname -r

4、行为准则

1、合入准则

TK采用TKCI保证合入代码的初步检测。 TKCI 是tkernel 自动CI系统 它可以自动监测TKERNEL https://git.woa.com/tlinux/tkernel4 仓库任意push 并对pushed commit/branch, 自动启动13个蓝盾测试包括一个 commit 规范检查12个内核不同config build测试并支持TKCONFIG 内核准入测试711case未来还会支持更多。 TK4合入准则

2、MR请求

各领域Reviewer

  • 现网运营问题: samuelliao(廖生苗)
  • TK通用Bug kaixuxia(夏开旭)
  • 如意相关问题: herberthbli(李弘博)
  • 悟能相关问题: aurelianliu(刘诗)
  • TK规范问题: alexsshi(时奎亮)
  • BPF工具问题: haisuwang(王海粟)
    (或可联系内核研发组任意同学)

五、如何加入 How To Join

  • 专职开发
    企微联系jasperwang(王佳)
  • Bug提交
    可以MR方式提交并联系前文提到的同学

六、团队介绍 Members

1、总览

image.png

2、新特性

悟能

悟能wiki空间
悟能(简称ECO),目前基于x86 corec-state、uncore duf两部分硬件节能。例如x86 cpu c-state来做能效架构设计。以x86为例在操作系统层面通过电源管理、cpu idle子系统、调度器子系统、中断子系统等使cpu空闲并且使其进入深度睡眠c6 state从而达到节能的目的。悟能的当前目标是保证性能的前提下争取节能。二期也就是现在到明年的目标是提高性能的前提下争取节能。

如意

如意wiki空间
如意TencentOS RUE(Resource Utilization Enhancement)是TencentOS产品矩阵中一款专为云原生场景下服务器资源QoS设计提升资源利用率降低运营成本的产品。如意是统一调度分配云上机器的CPU、IO、网络、内存等资源相比传统的服务器资源管理方案如意更适用于云场景能够显著提升云上机器的资源使用效率降低云上客户的运营成本为公有云、混合云、私有云等客户提供资源增值服务。

七、版本规划及changelog

1、版本规划

版本规划详见: https://iwiki.woa.com/pages/viewpage.action?pageId=4007003111

2、changelog

changelog详见 https://iwiki.woa.com/pages/viewpage.action?pageId=4007003117