Received: by 10.223.185.116 with SMTP id b49csp2181585wrg; Thu, 15 Feb 2018 07:44:31 -0800 (PST) X-Google-Smtp-Source: AH8x226ux8qK0QJz7bi6U4z+dKyI/RG12vIxIoj8+WQbcFDupD/sNxcRk8KpLmNS8kdAMN9DdnMk X-Received: by 2002:a17:902:7f0b:: with SMTP id d11-v6mr3029186plm.350.1518709471597; Thu, 15 Feb 2018 07:44:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518709471; cv=none; d=google.com; s=arc-20160816; b=Qg+CSKQ/HyPuyFRlqvSIIYatFepl65HC/ZnyCEXJff3e8w+t7CCLZUtOzbtz5SOxBO HgXBp6Aqo/oNivf8L9vCJjrul85A/z+YqzcvUOMIQRNemzBRwa/KDMvNtAYVsuKMsvn+ WKrpN7Qrx3BNPB6uP7sC81IvMqBJxfVAS1oRKe/62CoaUq8hLWJdmTE87Q/W5tmtgCUQ zOhAOwuCjjzxiPSgNTBl9XLcHnQTxy8Y4mptEE27OIf5C325s0zz8qjs6KD21tCvsudJ n+E4K5f/6pyf5Cvf6JE8H9EFQYl7gDmBBiW0sRUNC6uKUirgUq2UvVrbdrdWX4O4jAom J19A== 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 :arc-authentication-results; bh=goNhHCrrylzGTPz1ZIonD0c6qC+z8AiRc5VmQFSLpNg=; b=uDLfzNWXpxL8xVB+CQIOli6hTYm5b7yDqsnupc++t/YKNlOflnQvOLJv1U1iBfeVfq Yx/3UIiVvH0dFG7hldIC2L1gS5KVt8SWOS0mD6BlRYsj6EhqYvGztw1HxCUMkL2Bv2DJ s5htuIiKpqv7EBuSCzLkGaMxRFFHue8ekFRsT1pJJ13NgTyJLd0w/qiU3QX6HOsWYLgC NqITaz3d7Me65m4YP481iFvaCHxhRND5WlxghbRUiGcZmfdXDx7uXYRCaC0h6+QH655q 4+Ve3ZK4Iekl50+cY9T52ID413gIeVVTAx/bQgrHc2FxpG+I8exCF6Yp/h2gHytXgZYU h+0Q== 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 a65si2627628pfc.36.2018.02.15.07.44.16; Thu, 15 Feb 2018 07:44:31 -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; 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 S1033957AbeBOPnH (ORCPT + 99 others); Thu, 15 Feb 2018 10:43:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33770 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033257AbeBOPnC (ORCPT ); Thu, 15 Feb 2018 10:43:02 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 420EFF97; Thu, 15 Feb 2018 15:43:00 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Galbraith , Trond Myklebust Subject: [PATCH 4.15 098/202] NFS: Add a cond_resched() to nfs_commit_release_pages() Date: Thu, 15 Feb 2018 16:16:38 +0100 Message-Id: <20180215151718.472175331@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust commit 7f1bda447c9bd48b415acedba6b830f61591601f upstream. The commit list can get very large, and so we need a cond_resched() in nfs_commit_release_pages() in order to ensure we don't hog the CPU for excessive periods of time. Reported-by: Mike Galbraith Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/write.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1837,6 +1837,8 @@ static void nfs_commit_release_pages(str set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags); next: nfs_unlock_and_release_request(req); + /* Latency breaker */ + cond_resched(); } nfss = NFS_SERVER(data->inode); if (atomic_long_read(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH)