Received: by 10.192.165.148 with SMTP id m20csp4183614imm; Mon, 30 Apr 2018 13:23:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/chwRD777iP8x7907Usal3UMymfyblxceqvj10SFkHNTWecyxwHtaOucZVG+/5blXBLrI X-Received: by 2002:a63:10a:: with SMTP id 10-v6mr10970801pgb.444.1525119799577; Mon, 30 Apr 2018 13:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119799; cv=none; d=google.com; s=arc-20160816; b=cAVYkp8KdFLDCAg9IbOz+R5lMbZDYIQjeKbxG0o6XDlrE1IdHxNsagbJDN8DaUqv4W 7XuRzN6BoIlVxSUXZ3Gd4YCirf87O87vusm1XH53prmPvYrA2zqH9iA6ImemlwIwwGYz lUvGy8Pu31eJRtz7Ev1bs/Ow+EaNArMjc2jSekFVQ0LQ4CaxS17WP6q3zAOiMf98WExU D9OYJr5Vk7vvE4ZGBsM/8r0wull40KQdZDZL5tdqXe6VaZ+5aE9vQ6Z9/vaGsFa41b17 4kNK0DxbQ5zLuvFhpedZ04ZAlIIIbCvmGu51HYOLWL9nyRW8ByrHcFb8zxu/xR5ahTyr hdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=MD7EnFlp7xJrZ3qcg/6G0tnJNhemfQilBU7YyTuX9Lc=; b=PNhhknlW12YG+ze/3nL/gVWxMa9Kh0GnXMhNevQWiM52iwPZ6v3/cLSBvf718apyhi YtWbfSeta0CCJfsxj6az7ng7VGDcKZM3KvMCiFqoR+rhPD4m9JQM/GLFRiSgV1pkt5U1 i3pHpz36eWqGhinjzJDX23JQ+3vGc2zvd/gUnPUmXT76NI2J/AepNmLK6hjuP27fey3Q +oZyMonkihCknz1yMQkAmkOmqqXmRbhtue5nfQXBezGJpf2VPcp5sANuh/+tVnoO94nd 04ZczS/vaITWyT4DAYT116bmuYdFOZsmOnuYvPKT2PlFjz+uf8Qpx+upB6mvzhnfrD7J rMRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10-v6si1024345pgp.496.2018.04.30.13.23.05; Mon, 30 Apr 2018 13:23:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756053AbeD3UVt (ORCPT + 99 others); Mon, 30 Apr 2018 16:21:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755745AbeD3T0l (ORCPT ); Mon, 30 Apr 2018 15:26:41 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5074622DC0; Mon, 30 Apr 2018 19:26:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5074622DC0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Dryomov , Jason Dillaman Subject: [PATCH 4.9 49/61] libceph: un-backoff on tick when we have a authenticated session Date: Mon, 30 Apr 2018 12:24:52 -0700 Message-Id: <20180430183955.481930116@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilya Dryomov commit facb9f6eba3df4e8027301cc0e514dc582a1b366 upstream. This means that if we do some backoff, then authenticate, and are healthy for an extended period of time, a subsequent failure won't leave us starting our hunting sequence with a large backoff. Mirrors ceph.git commit d466bc6e66abba9b464b0b69687cf45c9dccf383. Cc: stable@vger.kernel.org # 4.7+ Signed-off-by: Ilya Dryomov Reviewed-by: Jason Dillaman Signed-off-by: Greg Kroah-Hartman --- net/ceph/mon_client.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -209,6 +209,14 @@ static void reopen_session(struct ceph_m __open_session(monc); } +static void un_backoff(struct ceph_mon_client *monc) +{ + monc->hunt_mult /= 2; /* reduce by 50% */ + if (monc->hunt_mult < 1) + monc->hunt_mult = 1; + dout("%s hunt_mult now %d\n", __func__, monc->hunt_mult); +} + /* * Reschedule delayed work timer. */ @@ -955,6 +963,7 @@ static void delayed_work(struct work_str if (!monc->hunting) { ceph_con_keepalive(&monc->con); __validate_auth(monc); + un_backoff(monc); } if (is_auth) { @@ -1114,9 +1123,7 @@ static void finish_hunting(struct ceph_m dout("%s found mon%d\n", __func__, monc->cur_mon); monc->hunting = false; monc->had_a_connection = true; - monc->hunt_mult /= 2; /* reduce by 50% */ - if (monc->hunt_mult < 1) - monc->hunt_mult = 1; + un_backoff(monc); } }