Todd Lipcon has posted comments on this change.

Change subject: service_queue: use futex for waking waiting rpc threads
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/2940/5/src/kudu/rpc/service_queue.cc
File src/kudu/rpc/service_queue.cc:

Line 61:     if (call != nullptr) {
> Done
Actually, moving it causes a crash during ServicePool::Shutdown(). The issue is 
that we have a single thread which calls ServicePool::Shutdown() on several 
different service pools, and ServicePool::Shutdown() uses BlockingGet() 
internally. This means that we have a thread which has a thread-local 
ConsumerState associated with a different pool which may have already been 
destroyed. This is OK in the case of accessing a shut-down queue, because we 
never use the ConsumerState. But, if we move the Reset() up outside the lock, 
then we will access ConsumerState even in the case of a shut-down queue.

I think the biggest cost of these memory accesses are the cache line misses for 
accessing ConsumerState. I think a prefetch instruction could probably mitigate 
that and move it outside the lock while still being safe in the case that it 
was already deleted.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ice7bb703d643b722f732f4c4ebc391d25796d3df
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Binglin Chang <[email protected]>
Gerrit-Reviewer: Henry Robinson <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to