惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
T
Threatpost
G
Google Developers Blog
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Exploit Database - CXSecurity.com
H
Heimdal Security Blog
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
Hacker News: Ask HN
Hacker News: Ask HN
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Schneier on Security
B
Blog
V2EX - 技术
V2EX - 技术
NISL@THU
NISL@THU
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Y
Y Combinator Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
Schneier on Security
Schneier on Security
F
Fortinet All Blogs
N
News | PayPal Newsroom
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
S
Security @ Cisco Blogs
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
Project Zero
Project Zero
I
Intezer
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler

博客园 - yooooooo

ftraceoption irq-info MPAM BE/ FE 的区别及功能 【ARM CoreLink 系列 5 -- CI-700 控制器介绍 】 ARM CoreLink 系列 4.3 -- NI-700 Component and interface identifiers ARM CCI-500 与 NI0700 的关系. ARM NIC-400 与 NI-700 的区别 claude code命令使用 【ARM Trace32(劳特巴赫) 使用介绍 2.2 -- TRACE32 进阶命令之 DIAG 弹框命令】 trace32 .cmm脚本和.t32文件的区别 【ARM Trace32(劳特巴赫) 使用介绍 2.1 -- TRACE32 Practice 脚本 cmm 脚本学习】 【ARM Trace32(劳特巴赫) 使用介绍 1.1 - Veloce 环境中使用trace32 连接 Cortex-M33】 PCIe 总线的 ASPM 和 链路状态机制总结 fw_devlink 功能 I3C协议详解 UART 协议规范 BPF 调度器 sched_ext 实现机制、调度流程及样例 Android Camera性能分析 录像Buffer Path详解 【UEFI基础】Protocol介绍 【UEFI实战】在库中使用全局变量 sched feature TTWU_QUEUE 【ARM CoreLink 系列 4.2 -- NI-700 Function units 详细介绍】 edk2构建编译流程 UEFI:FDF文件及FD、FV、FFS EDK II PCD的概念、类型、使用 PELT算法浅析 load_balance函数代码详解 UEFI Boot Manager Linux 内核中sched_prio_to_weight转换关系 CFS任务放置代码详解 CFS任务的负载均衡(load balance)
Linux misfit task
yooooooo · 2025-11-09 · via 博客园 - yooooooo

在 Linux 内核中,“misfit task” 是调度器(scheduler)中的一个术语,用来描述任务(task)与 CPU 性能等级不匹配的情况。
这个概念主要出现在 EAS(Energy Aware Scheduling)/schedutil 等现代调度框架中,用于优化性能和功耗平衡。

一、定义

“Misfit task” 指的是:

当前 CPU 的算力不足以高效运行该任务,该任务应该被迁移到一个性能更强的 CPU 上。

换句话说,就是任务被分配到了一个 “太弱的核” 上,比如把高负载任务放在 LITTLE 核(A55)上。

二、出现背景

在 big.LITTLE 架构(异构多核)中,CPU 分为:

  • big 核:性能高,功耗高;
  • LITTLE 核:性能低,功耗低。

调度器为了省电,会优先在 LITTLE 核上运行任务。
但有些任务实际负载较大,会让 LITTLE 核满负荷运行,却仍然执行缓慢——这就是 misfit task

三、判断逻辑(代码角度)

kernel/sched/fair.c 中,Linux 内核通过计算任务的 负载与 CPU capacity 的比例 来判断:

if (task_util(p) > capacity_of(cpu))
    mark_cpu_has_misfit_task(cpu);

解释:

  • task_util(p):任务当前的 CPU utilization(通常来自 PELT 负载模型);
  • capacity_of(cpu):当前 CPU 的算力(会受 DVFS、EAS 等影响);
  • 当任务的需求超过该 CPU 的能力,就认为这个 CPU 上存在 misfit task

四、调度器行为

一旦 CPU 被标记为有 misfit task

  1. 调度器会在 负载均衡(load balance) 时尝试将这个任务迁移到更强的 CPU;
  2. 通常发生在 find_busiest_group()find_busiest_queue() 的过程中;
  3. EAS 模式下,还可能触发性能域(performance domain)的能量模型更新。

简化示意:

task_util = 700
cpu0_capacity = 512 (LITTLE)
cpu4_capacity = 1024 (big)

→ 任务在 cpu0 上是 misfit task → scheduler 会迁移到 cpu4

五、相关内核变量

你可以在 /proc/sys/kernel/sched_* 或调度 trace 中看到类似字段:

  • misfit_task:当前 CPU 是否存在 misfit task;
  • sched_cpu_misfit:在负载均衡时的迁移统计;
  • trace_sched_misfit_task:ftrace 事件,用于分析任务迁移原因。

六、调度优化意义

  • 避免任务卡在低性能核上;
  • 提升响应速度;
  • 让 big.LITTLE 调度更加智能;
  • 减少因错误核绑定导致的延迟。

七、总结一句话

misfit task = 当前核跑不动的任务
内核检测到后,会尽快把它迁移到性能更强的 CPU 上,从而提升整体性能。