New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spdk: -march=core2 instead of -march=native #23078
Conversation
-march=native causes gcc to use opcodes according to whichever CPU happens to be installed in the build host, which can be different for every build. This makes it impossible to achieve a reproducible build. Also, if the build host has a very new CPU, running the resulting binaries on older CPUs (of the same family, i.e. x86_64) could result in segmentation fault. Hopefully nobody will be running Ceph on x86_64 CPUs older than Core2 (?) Fixes: http://tracker.ceph.com/issues/24948 Signed-off-by: Nathan Cutler <ncutler@suse.com>
|
It is also worth noting that the current code throws a compile error when built with a X86 CPU or -march older than core2. According to Wikipedia, core2 CPUs were released 2006-2009. |
|
@bmwiedemann Indeed. In case anyone is interested, that error was reproduced in the CI, and quoted at #23076 (comment) |
|
it does address the problem, but i am not sure it is the right route in long term to patch SPDK. i'd suggest add an option named |
|
this? |
|
+1 to @tchaikov on introducing additional explicit option to denote target machine. One of the drawback of this proposed solution - it might negatively impact the performance as we stop benefiting from new CPU features. |
|
@tchaikov did you mean add an option (calling it "x86_64-flavor" here) to configure allowing to override the I agree that would probably be more acceptable to SPDK upstream. @ifed01 I agree that there is a potential negative performance impact, which is the price we are paying here for a reproducible build. |
|
@smithfarm - my major concern is that such impact is unavoidable and well-hidden with this patch. |
|
@smithfarm i mean, a |
|
@tchaikov Wouldn't SPDK have to first fix the bug where it fails to compile (on x86_64) if UPDATE: Also, I assume completely removing |
|
@ifed01 I understand, and would consider adding something to the documentation if we knew what the performance impact really was. The problem I see here is we are shipping only one set of packages. If I understand this issue correctly, if we build SPDK with If we had an option to publish different flavors of the build, we could try to build on a very new CPU and publish a flavor for that type of CPU. But that's beyond the scope of this PR. |
|
@smithfarm yeah, that issue should be addressed also. might want to report it back to upstream, though. |
* refs/pull/23078/head: spdk: -march=core2 instead of -march=native Reviewed-by: Josh Durgin <jdurgin@redhat.com>
-march=native causes gcc to use opcodes according to whichever CPU happens to
be installed in the build host, which can be different for every build. This
makes it impossible to achieve a reproducible build.
Also, if the build host has a very new CPU, running the resulting binaries on
older CPUs (of the same family, i.e. x86_64) could result in segmentation
fault.
Hopefully nobody will be running Ceph on x86_64 CPUs older than Core2 (?)
Fixes: http://tracker.ceph.com/issues/24948
Signed-off-by: Nathan Cutler ncutler@suse.com