高级配置与电源管理接口(Advanced Configuration and Power Interface)是提供操作系统与应用程序管理所有电源管理接口,包括了各种软件和硬件方面的规范。2004年推出3.0规范;2009年推出4.0规范;2011年推出5.0规范。2013年之后新的ACPI规格将由UEFI论坛制定。ACPI可以实现的功能包括:电源管理;性能管理;配置与即插即用;系统事件;温度管理;电池管理;SMBus控制器;嵌入式控制器。
[HW,ACPI]
acpi={force|off|noirq|strict|rsdt|nocmcff|copy_dsdt}
ACPI的总开关。
force 表示强制启用ACPI(即使BIOS中已关闭);
off 表示强制禁用ACPI(即使BIOS中已开启);
noirq 表示不要将ACPI用于IRQ路由;
strict 表示严格要求系统遵循ACPI规格(降低兼容性);
rsdt 表示使用老旧的RSDT(Root System Description Table)代替较新的XSDT(Extended System Description Table);
copy_dsdt 表示将DSDT(Differentiated System Description Table)复制到内存中。
更多信息可参考Documentation/power/runtime_pm.txt以及"pci=noacpi"。
[HW,ACPI]
acpi_backlight={vendor|video}
选择屏幕背光亮度调节驱动。
video(默认值)表示使用通用的ACPI video.ko驱动(CONFIG_ACPI_VIDEO),该驱动仅可用于集成显卡。
vendor表示使用厂商特定的ACPI驱动(thinkpad_acpi,sony_acpi等)。
详见Documentation/acpi/video_extension.txt文档。
[HW,ACPI]
acpi_os_name="字符串"
告诉ACPI BIOS操作系统的名称。
常用于哄骗有缺陷的BIOS,让其以为运行的是Windows系统而不是Linux系统。
"Linux" = Linux
"Microsoft Windows" = Windows 98
"Windows 2000" = Windows 2000
"Windows 2001" = Windows XP
"Windows 2001 SP2" = Windows XP SP2
"Windows 2001.1" = Windows Server 2003
"Windows 2001.1 SP1" = Windows Server 2003 SP1
"Windows 2006" = Windows Vista
"Windows 2006 SP1" = Windows Vista SP1
"Windows 2006.1" = Windows Server 2008
"Windows 2009" = Windows 7 / Windows Server 2008 R2
"Windows 2012" = Windows 8 / Windows Server 2012
"Windows 2013" = Windows 8.1 / Windows Server 2012 R2
[HW,ACPI]
acpi_osi="字符串"
对于较新的内核(Linux-2.6.23之后)而言,当BIOS询问内核:"你是Linux吗?",内核都会回答"No",但历史上(Linux-2.6.22及更早版本)内核会如实回答"Yes",结果造成很多BIOS兼容性问题(主要是电源管理方面)。具体故事的细节请到内核源码文件drivers/acpi/osl.c中搜索"The story of _OSI(Linux)"注释。
此参数用于修改内核中的操作系统接口字符串(_OSI string)列表默认值,这样当BIOS向内核询问:"你是xxx吗?"的时候,内核就可以根据修改后的列表中是否存在"xxx"回答"Yes"或"No"了,主要用于解决BIOS兼容性问题导致的故障(例如屏幕亮度调整)。
acpi_osi="Linux"表示添加"Linux";
acpi_osi="!Linux"表示删除"Linux";
acpi_osi=!* 表示删除所有字符串(v3.13新增),可以和多个acpi_osi="Linux"格式联合使用;
acpi_osi=! 表示删除所有内置的字符串(v3.13新增),可以和多个acpi_osi="Linux"格式联合使用;
acpi_osi= 表示禁用所有字符串,仅可单独使用(不能联合使用)。
[HW,ACPI]
acpi_serialize
强制内核以串行方式执行AML(ACPI Machine Language)字节码。用于解决某些有缺陷的BIOS导致的故障。
[ACPI]
acpi_enforce_resources={strict|lax|no}
检查驱动程序和ACPI操作区域(SystemIO,SystemMemory)之间资源冲突的方式。
strict(默认值)禁止任何驱动程序访问已被ACPI声明为"受保护"的操作区域,这是最安全的方式,可以从根本上避免冲突。
lax允许驱动程序访问已被ACPI声明的保护区域(但会显示一个警告)。这可能会造成冲突,但是可以兼容某些老旧且脑残的驱动程序(例如某些硬件监控驱动)。
no表示根本不声明任何ACPI保护区域,也就是完全允许任意驱动程序访问ACPI操作区域。
[ACPI]
pnpacpi=off
禁用ACPI的即插即用功能,转而使用古董的PNPBIOS来代替。
struct sd_lb_stats {
struct sched_group *busiest; /* Busiest group in this sd */
struct sched_group *this; /* Local group in this sd */
unsigned long total_load; /* Total load of all groups in sd */
unsigned long total_pwr; /* Total power of all groups in sd */
unsigned long avg_load; /* Average load across all groups in sd */
/** Statistics of this group */
unsigned long this_load; //当前调度组的负载
unsigned long this_load_per_task; //当前调度组的平均负载
unsigned long this_nr_running; //当前调度组内运行队列中进程的总数
unsigned long this_has_capacity;
unsigned int this_idle_cpus;
/* Statistics of the busiest group */
unsigned int busiest_idle_cpus;
unsigned long max_load; //最忙的组的负载量
unsigned long busiest_load_per_task; //最忙的组中平均每个任务的负载量
unsigned long busiest_nr_running; //最忙的组中所有运行队列中进程的个数
unsigned long busiest_group_capacity;
unsigned long busiest_has_capacity;
unsigned int busiest_group_weight;
for_each_cpu(i, sched_group_cpus(group)) {
/*rq->cpu_power表示所在处理器的计算能力,在函式sched_init初始化时,会把这值设定为SCHED_LOAD_SCALE (=Nice 0的Load Weight=1024).并可透过函式update_cpu_power (in kernel/sched_fair.c)更新这个值.*/
unsigned long power = power_of(i);
unsigned long capacity = DIV_ROUND_CLOSEST(power,SCHED_POWER_SCALE);
unsigned long wl;
if (!cpumask_test_cpu(i, cpus))
continue;
rq = cpu_rq(i);
/*获取队列负载cpu_rq(cpu)->load.weight;*/
wl = weighted_cpuload(i);
/*
* When comparing with imbalance, use weighted_cpuload()
* which is not scaled with the cpu power.
*/
if (capacity && rq->nr_running == 1 && wl > imbalance)
continue;
/*
* For the load comparisons with the other cpu's, consider
* the weighted_cpuload() scaled with the cpu power, so that
* the load can be moved away from the cpu that is potentially
* running at a lower capacity.
*/
wl = (wl * SCHED_POWER_SCALE) / power;
if (wl > max_load) {
max_load = wl;
busiest = rq;
}
在load_balance中,move_tasks返回失败也就是ld_moved==0,其中sd->nr_balance_failed++对应can_migrate_task中的”too many balance attempts have failed”,然后busiest->active_balance = 1设置,active_balance = 1。
12345
if (active_balance)
//如果pull失败了,开始触发push操作
stop_one_cpu_nowait(cpu_of(busiest),
active_load_balance_cpu_stop, busiest,
&busiest->active_balance_work);