GitHub PushEvent at 2014-04-22 20:05:16
Repository: ceph
Actor: gregsfortytwo
Payload: {"shas":[["6c82cac03cf012a86de4d8934ae3821e0853759d","79e2475f81a6317276bf7cbb3958b20d289b78df@inktank.com","SimpleMessenger: Don't grab the lock when sending messages if we don't have to\n\nWe'd like it if sending a message didn't require any global locks, but the\nsubmit_message() function conditionally needs it in order to create new\nPipes. So:\n1) When failing on a dud Pipe, verify that it's still the Pipe the Connection\nis linked to; if not, try sending along the newly-linked Pipe.\n2) Add an \"already_locked\" param to submit_message\n3) Have the Connection-based interface set this param to false, and\nthe addr-based interface set it to true, reflecting whether they have\ntaken the SimpleMessenger::lock.\n4) If we discover we need to reference global data structures in\nsubmit_mesage:\n  4a) if locked, do as we previously have\n  4b) if not locked, take the lock, look up the relevant Pipe (by address),\n      and call into submit_message again.\n\nThe net effect of this is that in the typical case, the Connection-based\n_send_message() function no longer acquires global locks, only per-Connection\nones. In the case where the Connection must recreate a Pipe, it falls back to\nperforming like the addr-based _send_message() does. In the case where\nwe are racing with somebody else recreating a Pipe(either us or the other\nend), we may try twice but we will still only take per-Connection/Pipe locks,\nwhich is a fair tradeoff for not taking the global lock.\n\nSigned-off-by: Greg Farnum <greg@inktank.com>","Greg Farnum",true]],"size":1,"ref":"refs/heads/wip-messenger-locking","head":"6c82cac03cf012a86de4d8934ae3821e0853759d"}