From patchwork Sun Nov 28 23:27:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12643245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4FA2C433F5 for ; Sun, 28 Nov 2021 23:28:23 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 479F121C8FE; Sun, 28 Nov 2021 15:28:14 -0800 (PST) Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id BC790200F3F for ; Sun, 28 Nov 2021 15:28:01 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id A5454255; Sun, 28 Nov 2021 18:27:56 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id A16B2C1AC4; Sun, 28 Nov 2021 18:27:56 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 28 Nov 2021 18:27:45 -0500 Message-Id: <1638142074-5945-11-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1638142074-5945-1-git-send-email-jsimmons@infradead.org> References: <1638142074-5945-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 10/19] lustre: ptlrpc: fix timeout after spurious wakeup X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Alex Zhuravlev so that final timeout don't exceed requested one WC-bug-id: https://jira.whamcloud.com/browse/LU-15086 Lustre-commit: b8383035406a4b7be ("LU-15086 ptlrpc: fix timeout after spurious wakeup") Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/45308 Reviewed-by: Andriy Skulysh Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/ptlrpc/ptlrpcd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/lustre/ptlrpc/ptlrpcd.c b/fs/lustre/ptlrpc/ptlrpcd.c index 9cd9d39..23fb52d 100644 --- a/fs/lustre/ptlrpc/ptlrpcd.c +++ b/fs/lustre/ptlrpc/ptlrpcd.c @@ -438,7 +438,7 @@ static int ptlrpcd(void *arg) DEFINE_WAIT_FUNC(wait, woken_wake_function); time64_t timeout; - timeout = ptlrpc_set_next_timeout(set); + timeout = ptlrpc_set_next_timeout(set) * HZ; lu_context_enter(&env.le_ctx); lu_context_enter(env.le_ses); @@ -447,12 +447,15 @@ static int ptlrpcd(void *arg) while (!ptlrpcd_check(&env, pc)) { int ret; - if (timeout == 0) + if (timeout == 0) { ret = wait_woken(&wait, TASK_IDLE, MAX_SCHEDULE_TIMEOUT); - else + } else { ret = wait_woken(&wait, TASK_IDLE, - HZ * timeout); + timeout); + if (ret > 0) + timeout = ret; + } if (ret != 0) continue; /* Timed out */