From patchwork Wed Jul 11 20:31:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1185421 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A672EDF25A for ; Wed, 11 Jul 2012 20:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932350Ab2GKUby (ORCPT ); Wed, 11 Jul 2012 16:31:54 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:58685 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753643Ab2GKUby (ORCPT ); Wed, 11 Jul 2012 16:31:54 -0400 Received: by yenl2 with SMTP id l2so1692027yen.19 for ; Wed, 11 Jul 2012 13:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=EuEeskTGH9nXQj9xdBcDqnw2s6Qzorev1E4HH+U+RaY=; b=bp4G1IFCdk3bgBG6Ye8FY/xh8cYoAvh9WYvnd8ruxKRkEzYG3nZGslwAAiRwz44sf+ Grev6kELjBurQ40NYChZEgRQzqTGdSkuYb9n9sCnDXgj7FHP08e5O+tQhB6X2tAMCEqG BSr397OPYonaWjwCklLiPOei8hj9cLEgiQdfFavAYBs4UrrZFaV6+sFIDUBw5rPMZtoR UITE1VzCgrjDU47enAVyl3jXVxzIprF+5KSR0vRhxyZCLISvPEs9yB+U1T3ecZRmhgeA c31ZBSwFtlPfzhKKdeOYO0ZjtvOF7BXcPwtlNO1FcES+BfUKqjwq09QwWxmbP4Q9xXdp sU4A== Received: by 10.43.92.67 with SMTP id bp3mr25960381icc.16.1342038713572; Wed, 11 Jul 2012 13:31:53 -0700 (PDT) Received: from degas.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id v17sm4847725igv.7.2012.07.11.13.31.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 13:31:52 -0700 (PDT) From: Chuck Lever Subject: [PATCH 15/15] NFS: Slow down state manager after an unhandled error To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Wed, 11 Jul 2012 16:31:52 -0400 Message-ID: <20120711203151.3767.79006.stgit@degas.1015granger.net> In-Reply-To: <20120711201718.3767.66867.stgit@degas.1015granger.net> References: <20120711201718.3767.66867.stgit@degas.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If the state manager thread is not actually able to fully recover from some situation, it wakes up waiters, who kick off a new state manager thread. Quite often the fresh invocation of the state manager is just as successful. This results in a livelock as the client dumps thousands of NFS requests a second on the network in a vain attempt to recover. Not very friendly. To mitigate this situation, add a delay in the state manager after an unhandled error, so that the client sends just a few requests every second in this case. --- fs/nfs/nfs4state.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5e3bebc..38959eb 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -2151,6 +2151,7 @@ static void nfs4_state_manager(struct nfs_client *clp) out_error: pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s" " with error %d\n", clp->cl_hostname, -status); + ssleep(1); nfs4_end_drain_session(clp); nfs4_clear_state_manager_bit(clp); }