diff options
author | Alex Elder <elder@inktank.com> | 2012-10-08 23:37:30 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-10 01:00:21 -0400 |
commit | 8618e30bc14b06bfafa0f164cca7b0e06451f88a (patch) | |
tree | 255279320cdbd2f82d48973d11183a2bdb929044 /net/ceph/messenger.c | |
parent | 588377d6199034c36d335e7df5818b731fea072c (diff) |
rbd: let con_work() handle backoff
Both ceph_fault() and con_work() include handling for imposing a
delay before doing further processing on a faulted connection.
The latter is used only if ceph_fault() is unable to.
Instead, just let con_work() always be responsible for implementing
the delay. After setting up the delay value, set the BACKOFF flag
on the connection unconditionally and call queue_con() to ensure
con_work() will get called to handle it.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index cad0d17ec45e..973c16c20c42 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -2398,24 +2398,8 @@ static void ceph_fault(struct ceph_connection *con) | |||
2398 | con->delay = BASE_DELAY_INTERVAL; | 2398 | con->delay = BASE_DELAY_INTERVAL; |
2399 | else if (con->delay < MAX_DELAY_INTERVAL) | 2399 | else if (con->delay < MAX_DELAY_INTERVAL) |
2400 | con->delay *= 2; | 2400 | con->delay *= 2; |
2401 | con->ops->get(con); | 2401 | set_bit(CON_FLAG_BACKOFF, &con->flags); |
2402 | if (queue_delayed_work(ceph_msgr_wq, &con->work, | 2402 | queue_con(con); |
2403 | round_jiffies_relative(con->delay))) { | ||
2404 | dout("fault queued %p delay %lu\n", con, con->delay); | ||
2405 | } else { | ||
2406 | con->ops->put(con); | ||
2407 | dout("fault failed to queue %p delay %lu, backoff\n", | ||
2408 | con, con->delay); | ||
2409 | /* | ||
2410 | * In many cases we see a socket state change | ||
2411 | * while con_work is running and end up | ||
2412 | * queuing (non-delayed) work, such that we | ||
2413 | * can't backoff with a delay. Set a flag so | ||
2414 | * that when con_work restarts we schedule the | ||
2415 | * delay then. | ||
2416 | */ | ||
2417 | set_bit(CON_FLAG_BACKOFF, &con->flags); | ||
2418 | } | ||
2419 | } | 2403 | } |
2420 | 2404 | ||
2421 | out_unlock: | 2405 | out_unlock: |