cpumask_copy(old, ¤t->cpus_allowed); for_each_online_cpu(cpu) {if(cpu == dying)continue;if(set_cpus_allowed_ptr(current, cpumask_of(cpu)))continue;/* Recheck banks in case CPUs don't all have the same */if(cmci_supported(&banks)) cmci_discover(banks,0); }set_cpus_allowed...
set_cpus_allowed_ptr() will fail with -EINVAL if the requested affinity mask is not a subset of the task_cpu_possible_mask() for the task being updated. Consequently, on a heterogeneous system with cpusets spanning the different CPU types, updates to the cgroup hierarchy can silently fail...
Ultimately, the function set_cpus_allowed_ptr achieves the same outcome as sched_setaffinity, but employs task_struct instead of PID. Test case: # cd /sys/kernel/tracing # echo 0 > tracing_on # echo round-robin > hwlat_detector/mode # echo hwlat > current_tracer # unshare --fork --...
通过学习Linux内核里的将近500个kernel api,学习linux驱动开发的核心通用技术 课程简介 Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和Unix的多用户、多任务、支持多线程和多CPU的操作系统。伴随着互联网的发展,Linux得到了来自全世界软件爱好者、组织、公司的支持。它除了在服务器操作系统方面保持着...
{set_cpus_allowed_ptr(task, cpumask_of_node(node));break; } } } 开发者ID:BWhitten,项目名称:linux-stable,代码行数:31,代码来源: /* * After a CPU went down cycle through all the others and rediscover * Must run in process context. ...
set_cpus_allowed_ptr(task, new_cpus); } css_task_iter_end(&it); } @@ -1505,7 +1509,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cs, int cmd, spin_unlock_irq(&callback_lock);if (adding || deleting) update_tasks_cpumask(parent); ...