You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2017/04/19 00:45:17 UTC

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Hello Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/6680

to review the following change.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................

gutil: stop supporting AMD Opteron K8 (take 2)

This removes a workaround for a bug in very old (circa 2003) Opteron
chips. The workaround was producing an extra branch around most of our
atomic operations. This likely has a negligible perf impact, but it's
possible the slightly smaller code would make us run a bit faster or
reduce branch mispredictions.

Previously we also entirely forgot to call this function, so it was in
fact never applying the workaround. This patch marks the function as a
constructor, which ensures that it gets automatically called by any
binaries using atomic ops.

Impala made a similar change[1][2] a while back and seems to have had
no real issues.

[1] https://gerrit.cloudera.org/#/c/2516/
[2] https://github.com/apache/incubator-impala/commit/a7c3f301bb1da14d6bb35d37aab47450c67cca0c

Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
---
M src/kudu/gutil/atomicops-internals-tsan.h
M src/kudu/gutil/atomicops-internals-x86.cc
M src/kudu/gutil/atomicops-internals-x86.h
3 files changed, 11 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/80/6680/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................


gutil: stop supporting AMD Opteron K8 (take 2)

This removes a workaround for a bug in very old (circa 2003) Opteron
chips. The workaround was producing an extra branch around most of our
atomic operations. This likely has a negligible perf impact, but it's
possible the slightly smaller code would make us run a bit faster or
reduce branch mispredictions.

Previously we also entirely forgot to call this function, so it was in
fact never applying the workaround. This patch marks the function as a
constructor, which ensures that it gets automatically called by any
binaries using atomic ops.

Impala made a similar change[1][2] a while back and seems to have had
no real issues.

[1] https://gerrit.cloudera.org/#/c/2516/
[2] https://github.com/apache/incubator-impala/commit/a7c3f301bb1da14d6bb35d37aab47450c67cca0c

Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Reviewed-on: http://gerrit.cloudera.org:8080/6680
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins
---
M src/kudu/gutil/atomicops-internals-tsan.h
M src/kudu/gutil/atomicops-internals-x86.cc
M src/kudu/gutil/atomicops-internals-x86.h
3 files changed, 11 insertions(+), 46 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6680/1/src/kudu/gutil/atomicops-internals-x86.cc
File src/kudu/gutil/atomicops-internals-x86.cc:

Line 70: static void AtomicOps_Internalx86CPUFeaturesInit() {
Is this guaranteed to load before glog? If not, what will happen in the LOG(FATAL) call below?

Why not just rename AtomicOps_x86CPUFeatureStruct (and stick to the original patch where this method is explicitly called) so there's no collision with the struct variant from tcmalloc? Or wrap it all in another namespace?


-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................


Patch Set 1: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Mike Percy has posted comments on this change.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6680/1/src/kudu/gutil/atomicops-internals-x86.cc
File src/kudu/gutil/atomicops-internals-x86.cc:

PS1, Line 107: 0fh
0fh == 0x0f? Is that typical parlance?


-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] gutil: stop supporting AMD Opteron K8 (take 2)

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: gutil: stop supporting AMD Opteron K8 (take 2)
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/6680/1/src/kudu/gutil/atomicops-internals-x86.cc
File src/kudu/gutil/atomicops-internals-x86.cc:

Line 70: static void AtomicOps_Internalx86CPUFeaturesInit() {
> Is this guaranteed to load before glog? If not, what will happen in the LOG
well, I think it's handier to just use a constructor function. tcmalloc seems to have switched to a module initializer as well, but they forgot to mark it static.

LOG(FATAL) still works even if glog isn't initted yet. It might not go to the right log file, but I think that's fine since this is so rare.


PS1, Line 107: 0fh
> 0fh == 0x0f? Is that typical parlance?
yea that's what they call it in docs, etc.


-- 
To view, visit http://gerrit.cloudera.org:8080/6680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4eff19c62741e7433e378f7e0725079ecbcf1a97
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes