Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1951286ima; Thu, 25 Oct 2018 07:28:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5cI80wz+sGxN3/CF2opnXeUaAgZbFLmz8UcQM8s4qLUgYhph7X3SMMshGBdub1TbsekUA6P X-Received: by 2002:a17:902:8c86:: with SMTP id t6-v6mr1766041plo.55.1540477725737; Thu, 25 Oct 2018 07:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477725; cv=none; d=google.com; s=arc-20160816; b=BfgiPO12Y1IU79Sy4E3OZzSl/qnTOxxuHDej4emcxd0h/RM9C/n4KhuauifB27LAY0 u4x4KNP4S4L1XUXd86b7dg9wTlyI+prFKPI6hxqVaZ3BGDuhyohBl2675TIHW8QGZlX9 z3fKBf8ZXSZvYAvB8njjXDhTrPky8Gt+wWxCJqhmvj4P5QBm/PS4XB28L/p21J1iOibc FUy5S7oddNPmRFIkF8ybEvedr4tSq/U/bIXyJM7duR1X6AwvjrY3nct79vQADSoeG0di wWOzTwZiiZSaZtum88y1ylLzHOVhruFQzku4GhxmGOM0maq8csatdJ07FEtgCh1HOBCZ hKYA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BQTF9eH6SxwyQGUFkcvTjFEfUVBVO6g2hhrydNQI9Hc=; b=r5Uhx6zdcFdrHJyh8F92YSNjjbBIkyitSQShaDJmifnpJhDDzqBpMabeE5F8YIkKoh xbMZhRgC6W+fGrSWdiUNRptfK2nJGNKqum37yZ/GDuc/ay9ZGy/7EYAnxbLwqlmt9MyN IGQ0UsU0+rm3rBMJZfEbdFcu78BsZ129DFWUWnE7vJlIv6XBXdH5m2fWs1rJo2axR0kW 0vHuvF4K7umw7ZoQzUue7VLvqC6Z2pKr4nzHJTDWUpWfrZ1XqlWR4iFBrL8J6MVUUEvi htFFoUfQBAOehPri+63E3VW4V3IYx2qtG2o/AmsWE15e2CJ72wtFHEEkg9+6kW0k0LdV 2UuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R2ialOtG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si7832294pgp.451.2018.10.25.07.27.52; Thu, 25 Oct 2018 07:28:45 -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; dkim=pass header.i=@kernel.org header.s=default header.b=R2ialOtG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730941AbeJYWxP (ORCPT + 99 others); Thu, 25 Oct 2018 18:53:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:35646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729514AbeJYWxO (ORCPT ); Thu, 25 Oct 2018 18:53:14 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31D4A20848; Thu, 25 Oct 2018 14:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477216; bh=obwSeL9KLSb/aZ1pAn2xfX7P/admnp3R8DC3BmlYf3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2ialOtG/85YJOkcaLWbioR9FroBY4QRu8jLbzXrN/AVPTxscfyjlTaSp/IXGFxUD YVriL/sokm6SVsGQMornjyiheyKTxorzdHz5/6OhWmB9IQ2qESXviiIidgrJaUZxWu K/44nMZ8xKTwpxSdrgPNlIqf65qKqkJNbKDl/ym8= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jeff Layton , Jeff Layton , Trond Myklebust , Sasha Levin Subject: [PATCH AUTOSEL 3.18 54/98] nfs: fix high load average due to callback thread sleeping Date: Thu, 25 Oct 2018 10:18:09 -0400 Message-Id: <20181025141853.214051-54-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141853.214051-1-sashal@kernel.org> References: <20181025141853.214051-1-sashal@kernel.org> 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 From: Jeff Layton [ 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