From patchwork Thu Feb 27 21:16:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CC21924 for ; Thu, 27 Feb 2020 21:50:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8497224690 for ; Thu, 27 Feb 2020 21:50:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8497224690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 5AB7834B945; Thu, 27 Feb 2020 13:41:23 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id EC44C3488A0 for ; Thu, 27 Feb 2020 13:21:02 -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 7606691AA; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 7498946C; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:16:36 -0500 Message-Id: <1582838290-17243-529-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 528/622] lustre: use simple sleep in some cases 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: Mr NeilBrown To match the OpenSFS branch change schedule_timeout_uninterruptible() to ssleep(). In mdc_request.c the change to ssleep() lets us remove a wait queue. In seq_client_alloc_meta() wait 2 seconds before attempting to run seq_client_rpc() again. WC-bug-id: https://jira.whamcloud.com/browse/LU-10467 Lustre-commit: 077b35568be5 ("LU-10467 lustre: don't use l_wait_event() for simple sleep.") Signed-off-by: Mr NeilBrown Reviewed-on: https://review.whamcloud.com/35966 Lustre-commit: d0ca764a1a91 ("LU-10467 lustre: don't use l_wait_event() for poll loops.") Reviewed-on: https://review.whamcloud.com/35968 Reviewed-by: James Simmons Reviewed-by: Shaun Tancheff Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/fid/fid_request.c | 7 +++++++ fs/lustre/llite/llite_lib.c | 3 ++- fs/lustre/lov/lov_request.c | 4 +++- fs/lustre/mdc/mdc_request.c | 5 ++--- fs/lustre/ptlrpc/events.c | 7 +++---- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/fs/lustre/fid/fid_request.c b/fs/lustre/fid/fid_request.c index a54d1e5..6cede30 100644 --- a/fs/lustre/fid/fid_request.c +++ b/fs/lustre/fid/fid_request.c @@ -40,6 +40,7 @@ #define DEBUG_SUBSYSTEM S_FID #include +#include #include #include @@ -155,6 +156,12 @@ static int seq_client_alloc_meta(const struct lu_env *env, */ rc = seq_client_rpc(seq, &seq->lcs_space, SEQ_ALLOC_META, "meta"); + if (rc == -EINPROGRESS || rc == -EAGAIN) + /* MDT0 is not ready, let's wait for 2 + * seconds and retry. + */ + ssleep(2); + } while (rc == -EINPROGRESS || rc == -EAGAIN); return rc; diff --git a/fs/lustre/llite/llite_lib.c b/fs/lustre/llite/llite_lib.c index 384b55b..7e128f0 100644 --- a/fs/lustre/llite/llite_lib.c +++ b/fs/lustre/llite/llite_lib.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -2344,7 +2345,7 @@ void ll_umount_begin(struct super_block *sb) * to decrement mnt_cnt and hope to finish it within 10sec. */ while (cnt < 10 && !may_umount(sbi->ll_mnt.mnt)) { - schedule_timeout_uninterruptible(HZ); + ssleep(1); cnt++; } diff --git a/fs/lustre/lov/lov_request.c b/fs/lustre/lov/lov_request.c index added19..d263cec 100644 --- a/fs/lustre/lov/lov_request.c +++ b/fs/lustre/lov/lov_request.c @@ -33,6 +33,8 @@ #define DEBUG_SUBSYSTEM S_LOV +#include + #include #include #include "lov_internal.h" @@ -130,7 +132,7 @@ static int lov_check_and_wait_active(struct lov_obd *lov, int ost_idx) mutex_unlock(&lov->lov_lock); while (cnt < obd_timeout && !lov_check_set(lov, ost_idx)) { - schedule_timeout_uninterruptible(HZ); + ssleep(1); cnt++; } if (tgt->ltd_active) diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c index 287013f..54f6d15 100644 --- a/fs/lustre/mdc/mdc_request.c +++ b/fs/lustre/mdc/mdc_request.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1043,13 +1044,11 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid, { struct ptlrpc_bulk_desc *desc; struct ptlrpc_request *req; - wait_queue_head_t waitq; int resends = 0; int rc; int i; *request = NULL; - init_waitqueue_head(&waitq); restart_bulk: req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE); @@ -1093,7 +1092,7 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid, exp->exp_obd->obd_name, -EIO); return -EIO; } - wait_event_idle_timeout(waitq, 0, resends * HZ); + ssleep(resends); goto restart_bulk; } diff --git a/fs/lustre/ptlrpc/events.c b/fs/lustre/ptlrpc/events.c index e6a49db..ce13aa6 100644 --- a/fs/lustre/ptlrpc/events.c +++ b/fs/lustre/ptlrpc/events.c @@ -34,9 +34,8 @@ #define DEBUG_SUBSYSTEM S_RPC #include -# ifdef __mips64__ -# include -# endif +#include +#include #include #include @@ -522,7 +521,7 @@ static void ptlrpc_ni_fini(void) if (retries != 0) CWARN("Event queue still busy\n"); - schedule_timeout_uninterruptible(2 * HZ); + ssleep(2); break; } }