Introduce CPUAffinity process property instead of execCPUAffinity#1296
Introduce CPUAffinity process property instead of execCPUAffinity#1296kad wants to merge 1 commit intoopencontainers:mainfrom
Conversation
|
@kolyshkin PTAL |
|
Given issues like golang/sys#259, I think it might be nice to have a way to indicate "all CPUs" as a way to reset affinity (but without doing |
theoretically, the higher-level runtime that generates OCI spec might be feeling it with right number based on detected system information. e.g. use result of |
|
fyi @bitoku |
My experience is that this rarely happens -- usually higher-level runtimes either hide new knobs like this (requiring you to specify patch Given that we have had seen practical issues with container runtimes being spawned with suboptimal CPU affinity values, I would suggest that having an "all" or "max" special value would be a good idea. Also you do not need to detect anything with |
cyphar
left a comment
There was a problem hiding this comment.
Also, when it comes to formatting -- in the OCI specs we do not hard-wrap lines at N columns. Each complete sentence should be one line (this makes diffs easier to read).
my point was that upper level runtime might be pinned to subset of CPUs (e.g. "infra reserved" partition of the system). OCI runtime when spawned from it, inherits affinity from parent process, thus
I don't mind adding special value
having all bits set is also might be considered unwanted. As I mentioned, there are setups where runtimes containerd/cri-o are restricted to subset of CPUs, and in those setups it might be unwanted if lower layer OCI runtimes would be using CPU time from other cores. |
|
A naive question -- is there a use case when we want different CPU affinities for different OCI hooks? |
|
@kolyshkin I think the point is to have the affinity change at different stages rather than it be hook-specific -- hooks will probably inherit them but hooks can also set their own affinity if they want to. The naming is similar to hooks because both correspond to runtime lifecycle stages. |
3041554 to
8e27850
Compare
|
@kolyshkin @giuseppe @cyphar update pushed with following changes, as suggested:
|
This change introduces more generic `cpuAffinity` property of `Process` to specify desired CPU affinities while performing operations on create, start and exec operations. Signed-off-by: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
|
How's this one looking, fellow @opencontainers/runtime-spec-maintainers (particularly those of you who've looked at it prior)? 👀 |
This change introduces more generic
CPUAffinityproperty ofProcessto specify desired CPU affinities while performing operations on create, start and exec operations.As it was originally discussed in PR #1253, the existing implementation covers only
execusecase, where setting affinity for OCI hooks and initial container process will benefit wider set of workloads.