Received: by 10.192.165.148 with SMTP id m20csp4148324imm; Mon, 30 Apr 2018 12:40:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAJ3QDVWdVLoNzaYZEa93/WzqG3BGc+YvQlcA+EHF3UoBdWLPQJl5223c6x8uleoksxYqI X-Received: by 2002:a17:902:7844:: with SMTP id e4-v6mr13432048pln.296.1525117221336; Mon, 30 Apr 2018 12:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525117221; cv=none; d=google.com; s=arc-20160816; b=s1+kEAptXeFlLJ0m/x+jWJpM2VIMH4uBSrIeXXZeJaoQY73KR+IB55ahiBRyK5rtsI e9L+ocdU4tXMDQaO6gzOoK/tpi7Wx67WBVhUbSqD7ZEWR6XzXV6ar73seB4HbASg4KzP UQfON00mRQfUb8fcL9J0DbEEvuRIGfw4NXSOBZEHPESeOI+Q6ZOKGwnswwo444iOXikG WyEtDjOg6x9VVfnTyJorrJKtNI2vtjQv9L/CwW4EcVe1aEKlJvIlJs8rrpdB0YBVD3Wh ZiP2ddjqKQJtYuU5luLnUGm6LUenAJ4P6CPJJHtWzV5YvGmrERoWfTeDHIV0o2UhmSoI PhoQ== 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=fV289p77wYI00Q6xdprzD/1rv6aWJa50OgfTirzDpYM=; b=xQENaSVujf2olnF8BUpxCa3Ui0kBzj+iHPpdlf/tXlbDw2HZH9djKezEx+q9SAKn0c Xmvt8IhCc35LiZL0aslePwhKox1qlauI9L78NJoEocO9qZJZuf5DWGQU4uSeplKRdh8/ v4EEfdoMBOUYlDN8HJD0lZzHYhhbvIJa2/fXvJnRZAjpEY70bMvekHf84BFIOThMq3NI sK2r8IcidxVbPo+Mz1k9mkGBXkCaUzetNte+z39HUzQc8I+zDlN8knBqkjTt2wj7Bc7J 9sabYPTaCluJDa9u8jYSrcUWkE4uwMEYoRMjvFpfJe6hlfPbBqIsZtMiXE3yM1uSinek erdA== 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 m1-v6si7848093plt.276.2018.04.30.12.40.07; Mon, 30 Apr 2018 12:40:21 -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 S1756543AbeD3Tij (ORCPT + 99 others); Mon, 30 Apr 2018 15:38:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755350AbeD3T2k (ORCPT ); Mon, 30 Apr 2018 15:28:40 -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 E03B122DBF; Mon, 30 Apr 2018 19:28:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E03B122DBF 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.16 086/113] libceph: un-backoff on tick when we have a authenticated session Date: Mon, 30 Apr 2018 12:24:57 -0700 Message-Id: <20180430184018.836367403@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@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.16-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. */ @@ -963,6 +971,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 && @@ -1123,9 +1132,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); } }