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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 AF261C27C40 for ; Thu, 24 Aug 2023 21:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692911467; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8GTqp6BmnrwR6XNpCmmOU9nykXbQIz530PxONgVS8GA=; b=H+rRNjCpOQgTX+G5d144eTQ5flFVVCogHGBnmGNDPH8BV9S2yGXY0VNxXYby3OMkJUEx76 1ED5LW0xAlaa9V8VLjWzymNSj1AJEvmu9QD2nK7ilOnyjLbLte28HXx5mtczNCAKOZHCLS ju/s/pk/mcFKHE6Xw3HE3+GfvSrOKx4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-VOvwUivpPoWaz2v8-1nFiw-1; Thu, 24 Aug 2023 17:11:06 -0400 X-MC-Unique: VOvwUivpPoWaz2v8-1nFiw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 904878D40A2; Thu, 24 Aug 2023 21:11:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 831434021B9; Thu, 24 Aug 2023 21:11:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3B7EA19465A2; Thu, 24 Aug 2023 21:11:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 99BFD1946589 for ; Thu, 24 Aug 2023 21:11:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7D391492C18; Thu, 24 Aug 2023 21:11:03 +0000 (UTC) Received: from pasta.redhat.com (unknown [10.45.224.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id F30A4492C14; Thu, 24 Aug 2023 21:11:02 +0000 (UTC) From: Andreas Gruenbacher To: cluster-devel@redhat.com Date: Thu, 24 Aug 2023 23:10:58 +0200 Message-Id: <20230824211101.3242346-2-agruenba@redhat.com> In-Reply-To: <20230824211101.3242346-1-agruenba@redhat.com> References: <20230824211101.3242346-1-agruenba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Subject: [Cluster-devel] [PATCH 1/4] gfs2: Switch to wait_event in gfs2_logd X-BeenThere: cluster-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: "\[Cluster devel\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cluster-devel-bounces@redhat.com Sender: "Cluster-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true In gfs2_logd(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index aa568796207c..d3da259820e3 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -1301,7 +1301,6 @@ int gfs2_logd(void *data) { struct gfs2_sbd *sdp = data; unsigned long t = 1; - DEFINE_WAIT(wait); while (!kthread_should_stop()) { @@ -1338,17 +1337,11 @@ int gfs2_logd(void *data) try_to_freeze(); - do { - prepare_to_wait(&sdp->sd_logd_waitq, &wait, - TASK_INTERRUPTIBLE); - if (!gfs2_ail_flush_reqd(sdp) && - !gfs2_jrnl_flush_reqd(sdp) && - !kthread_should_stop()) - t = schedule_timeout(t); - } while(t && !gfs2_ail_flush_reqd(sdp) && - !gfs2_jrnl_flush_reqd(sdp) && - !kthread_should_stop()); - finish_wait(&sdp->sd_logd_waitq, &wait); + t = wait_event_interruptible_timeout(sdp->sd_logd_waitq, + gfs2_ail_flush_reqd(sdp) || + gfs2_jrnl_flush_reqd(sdp) || + kthread_should_stop(), + t); } return 0; -- 2.40.1