The information about the CPs online in an LPAR is stored in a control block.
The code navigates to the right control block and returns the number.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/unittests/Support/Host.cpp | ||
---|---|---|
39–40 | Minor nit: grammar |
llvm/unittests/Support/Host.cpp | ||
---|---|---|
39–40 | The x86_64 part of the sentence is meant to be distributed across "Linux" and "Darwin" and not to z/OS. With the new formulation, x86_64 needs to be added to before "Darwin" to retain the intended meaning. | |
43 | Minor nit: Aside for Windows, where the expression here is not sensitive to the platform architecture, can we structure this to consistently group by architecture? Alternatively, consistently group by OS. |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | If z/OS supports something similar to taskset -c 0-3 $program, make sure the function returns a number less than or equal to 4. |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | Thanks for the hint. This kind of command is not supported on z/OS. |
llvm/unittests/Support/Host.cpp | ||
---|---|---|
39–40 | I hope the new order is better. |
LGTM with minor comment.
llvm/unittests/Support/Host.cpp | ||
---|---|---|
39–40 | I think the comment doesn't need to indicate the list (note that the duplication led to Windows being in one list and not ther other). The comment does help in explaining what the function does though. |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | @MaskRay, I think the test you propose imposes an additional restriction that I am not sure the existing implementations of the function adhere to. Namely, I believe the test that you proposed indicates that the intent is to return a number that is one greater than the highest processor index number on the system. I think this might differ from the count of available processors. My understanding is that the function is meant to return the latter. |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | @hubert.reinterpretcast Actually both the Linux & Windows implementations return the restricted set of CPUs/processors that are usable within the process (ie. CPUs represented by the affinity mask). |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | The restricted set is what I meant by "available". In other words, I understand that the current implementations returns what you describe. My comment was on the relationship between the count and the index. If the first usable index is higher than the count, then the command MaskRay proposed would fail. |
llvm/lib/Support/Host.cpp | ||
---|---|---|
1334 | Sorry wrong example, that should return 4, as CPU 6 & 7 should be on the same core on a SMT system, but you got the idea. |
If z/OS supports something similar to taskset -c 0-3 $program, make sure the function returns a number less than or equal to 4.