Received: by 10.192.165.148 with SMTP id m20csp4161505imm; Mon, 30 Apr 2018 12:58:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZplSQ8qs4Z6V6x4jU0ubKiKjSkCrsO2qpSg6mXU+NTwnm/3gW9m2HTnkLlznH/D93b3gy6v X-Received: by 10.98.79.12 with SMTP id d12mr13102405pfb.220.1525118280268; Mon, 30 Apr 2018 12:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118280; cv=none; d=google.com; s=arc-20160816; b=OBgpLDW4rzEDvQjlqhRt7cwW3FXrN8Yd9fU22Y88Hb19coqBlaF4ePfxGfcwTMlHDT kbUq4ylLJn8QMJuOnfLFNS8qIYkFlNUcr9bdobuRYKwKJGHv2SDU/hudrfFWyTiFkldw 4tsVKjI63WbTzsQeV/y5F2vynxiEzunMKYdQsnsKf97Wh+dHOhWeW+HTq9u6OFpkw46K chRrHfBv3dzjirsneZSSx+4Hd9Qh3LY+y5cezC7/haQNWxb5fVBVYqA0++X899Xh4Y33 c1OC4M1M/fuqQWmpqjBriB+WA+OCIUO0S8o9J1WWFVZPzjd+ZKHwxmC3Z3HJCvhcjryE QoKA== 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=LpQEQEikT9RlTA61if5potvP2VjLDdoT3WKwffdqHDY=; b=TKcU36cS1tXtTFkY9VheC6aRthbsXeUPYgWXvuGmebTWMx05+FHvrw58ta2KgaVPhs IWhR5SAG/XIenUPn2aNz0wC+dYYR4aUFkUvysngEsVgrC9aCuhguq+M1bRCwgQIuXxGt ZCtYrQdVTc878Y2dKuEaCxJrjhRrp56+2PgZIEU5qlFjE9OgEd/Sx6LjekDTaC4sLd6f f3dtqV7XTTFNdsTVEbXoPSsZxsvoe3OLpei4/oeKvhgA/fj28uLgKl2tPa76M+9TcdiU hNRP48D2wPNH+aPLXOLRey0WCyF12e6whT5OKlkrUS83WTegS/2O6a/ElvAyAbIXFtgR xoqg== 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 f7-v6si4518271pgc.320.2018.04.30.12.57.46; Mon, 30 Apr 2018 12:58:00 -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 S1756051AbeD3T43 (ORCPT + 99 others); Mon, 30 Apr 2018 15:56:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:34720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756071AbeD3T1v (ORCPT ); Mon, 30 Apr 2018 15:27:51 -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 0DCA222E02; Mon, 30 Apr 2018 19:27:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DCA222E02 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.14 73/91] libceph: un-backoff on tick when we have a authenticated session Date: Mon, 30 Apr 2018 12:24:55 -0700 Message-Id: <20180430184008.072931788@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@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.14-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); } }