[LinuxCNC/linuxcnc PR#295] uspace: Find top online CPU

未分类 bolang 4个月前 (10-15) 23次浏览

Issue #295 | 状态: 已关闭 | 作者: jepler | 创建时间: 2017-06-27


NOTE This is PR relative to master branch, but we should consider whether to port it back to 2.7, because it affects that version. (however, it is not a regression)

Before this change, uspace assumed that online CPU numbers were consecutive, and attempted to schedule the real time tasks on the highest numbered CPU. For example, if SCNPROCESSORS_ONLN returns 8, then it is assumed that the online processors are 0-7, and processor number 7 is selected for real time tasks.

This is not always the case. For example, on a D525 with HT turned off via BIOS, it is reported that SCNPROCESSORS_ONLN is 2 and the online processors are 0,2. The old algorithm chooses processor number 1 for realtime, so no realtime thread is ever run.

While my HT system (i7-4790K) can turn off HT in the BIOS, it gets online processors 0-3 when this is done, so the buggy behavior is not provoked. However, if I take a CPU offline which is not the highest numbered CPU, e.g., with
$ sudo sh -c ‘echo 0 > /sys/devices/system/cpu/cpu6/online’
I can provoke the reported behavior. After this change, cpu number 7 is again selected (correctly) instead of cpu number 6 (incorrectly).

Closes: #294

Signed-off-by: Jeff Epler


评论 (1)

#1 – SebKuzminsky 于 2017-06-29

PR #296 merged into 2.7, so this one is no longer needed.


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/295

喜欢 (0)