Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp55092imu; Thu, 8 Nov 2018 14:41:24 -0800 (PST) X-Google-Smtp-Source: AJdET5e/sExz5zhaQbylYjSKow7Rvlm74Ys4VuzkFkyr8QJiTDBFS97xNxma3eSsFfv7y6ywN0Ib X-Received: by 2002:a63:62c3:: with SMTP id w186mr5427130pgb.345.1541716884165; Thu, 08 Nov 2018 14:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716884; cv=none; d=google.com; s=arc-20160816; b=R3mqG0peKXIaCwVH64hBLROXlxSjt4TZ8lf7UVnHEgjJSJJ7+yJKzhj5jgF3h4F/CK F5Lacc+OpyubZKToYA8tMZZWZpwEvzbrMX2ikD6cWnNHax5DAMQc2qxjhAOyn3OWZDWx q5BrVEXO25SL+JhkvuUc8N9wmtTC7MP8owjtYBMauvZ9QKz701oM0fIDbODLAuY/GSTB ZRdzz5RcnScCc/bfa2KPU1a5Nuc/QajjySTXiTLQfk7SIPf/iKbw05cY0PozCOILjHzp Goqi6jFiXHJEbnEMHw20Xo5FEDTF7eT8yrXytcNjhUhsJVLDXW6r9qu/V5hobZqkWgSA iwoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+NwE6raKaqbRZg616BqtpMkNbPb+tEz1WRI19oTrI68=; b=tu7iAAU7Wdy6a0Ma0FMPc0T9zeAiOFEH1WGN2oQdINTZEEY/ccocQd4PuWQn8d1UqF mfQ6+2sYsX3QaUh/1bTU6EGupDeFlnKLtHA2e7rOBoKjnFWeGqQ0Ek01WfqgXqIe6Qcx qapYX7acDJ9g6ScsaCut6kzK4G3kyb2S8oQEV3znoFvNOrcwnUhpdw5OVh3RLF+3Cnzk f9KNzx0sNDlDm/7a13/fwR1KdgweXbRW0y2yIKcZQmpPYvzJSjgj4C+6lnqT6tGCZYYk v2TS/kNI0RQ/EAYMR4TVlsleYLEgBiV7NbQLw9XoWQxClc0Ikrif8ndJtRgO76fyKeHP mksw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Y2Bh9TX/"; 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 i128-v6si5593127pfb.256.2018.11.08.14.41.08; Thu, 08 Nov 2018 14:41:24 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="Y2Bh9TX/"; 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 S1728549AbeKIISa (ORCPT + 99 others); Fri, 9 Nov 2018 03:18:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:49870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729066AbeKIHdo (ORCPT ); Fri, 9 Nov 2018 02:33:44 -0500 Received: from localhost (unknown [208.72.13.198]) (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 C4AF620989; Thu, 8 Nov 2018 21:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714176; bh=fv3FEv7L+dwDbpOxituw7wGAYho4RGsRFVWmM4NAC4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2Bh9TX/xth0VR7H0NOjo1zKY8d+n74XWi2sYMV3U5+hri6A+/8TyUrXcHzpFu4tr 7m3O7Pb56KjvIf2AAoqQdjd+KYCZmvpXUOvV6QqJxkSdErGjfXxxvchacnzyh6IQtz 1T7vszNKhlIsWWT+NYj7gc0mc1pPtEZPXlwBWFG0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Jeff Layton , Trond Myklebust , Sasha Levin Subject: [PATCH 3.18 083/144] nfs: fix high load average due to callback thread sleeping Date: Thu, 8 Nov 2018 13:50:54 -0800 Message-Id: <20181108215101.410321774@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 5d05e54af3cdbb13cf19c557ff2184781b91a22c ] Chuck pointed out a problem that crept in with commit 6ffa30d3f734 (nfs: don't call blocking operations while !TASK_RUNNING). Linux counts tasks in uninterruptible sleep against the load average, so this caused the system's load average to be pinned at at least 1 when there was a NFSv4.1+ mount active. Not a huge problem, but it's probably worth fixing before we get too many complaints about it. This patch converts the code back to use TASK_INTERRUPTIBLE sleep, simply has it flush any signals on each loop iteration. In practice no one should really be signalling this thread at all, so I think this is reasonably safe. With this change, there's also no need to game the hung task watchdog so we can also convert the schedule_timeout call back to a normal schedule. Cc: Reported-by: Chuck Lever Signed-off-by: Jeff Layton Tested-by: Chuck Lever Fixes: commit 6ffa30d3f734 (“nfs: don't call blocking . . .”) Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/callback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 3b8cdb8298c4..a78558a25035 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -128,7 +128,7 @@ nfs41_callback_svc(void *vrqstp) if (try_to_freeze()) continue; - prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_UNINTERRUPTIBLE); + prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE); spin_lock_bh(&serv->sv_cb_lock); if (!list_empty(&serv->sv_cb_list)) { req = list_first_entry(&serv->sv_cb_list, @@ -142,10 +142,10 @@ nfs41_callback_svc(void *vrqstp) error); } else { spin_unlock_bh(&serv->sv_cb_lock); - /* schedule_timeout to game the hung task watchdog */ - schedule_timeout(60 * HZ); + schedule(); finish_wait(&serv->sv_cb_waitq, &wq); } + flush_signals(current); } return 0; } -- 2.17.1