Hello Sailesh Mukil,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/5905
to review the following change.
Change subject: KUDU-1865 (part 1): reduce some cross-thread allocations
......................................................................
KUDU-1865 (part 1): reduce some cross-thread allocations
Per the analysis in the JIRA, each RPC caused two "cross-thread"
allocations of ReactorTasks (one in the client, one in the server).
These cross-thread allocations harm tcmalloc caching.
ReactorTasks don't actually need to be heap-allocated -- that was only
an easy mechanism to use a normal-looking "interface" paradigm. Instead,
if we use a struct with some std::functions in it, and std::move() it
to/from the pending tasks container, we avoid the heap allocation. More
importantly, we avoid the worst kind of heap allocation which is
allocated on one thread and freed on another.
I verified that this removed the cross-thread allocation traffic using
tcmalloc tracing and the script posted to the JIRA.
Change-Id: I7d4d5f14fb302196b1797c712b21cfce81f157c1
---
M src/kudu/rpc/connection.cc
M src/kudu/rpc/connection.h
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/messenger.h
M src/kudu/rpc/reactor.cc
M src/kudu/rpc/reactor.h
6 files changed, 148 insertions(+), 249 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/05/5905/1
--
To view, visit http://gerrit.cloudera.org:8080/5905
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d4d5f14fb302196b1797c712b21cfce81f157c1
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Sailesh Mukil <[email protected]>