Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1727163pxb; Wed, 12 Jan 2022 23:51:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZz9WC89Ppog3O/sLJSoPezODm5JpLGNMcbJMe2NN4d/2cqFlGwmaAR5QkxOope52jQusg X-Received: by 2002:aa7:d6cd:: with SMTP id x13mr3044261edr.352.1642060269100; Wed, 12 Jan 2022 23:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642060269; cv=none; d=google.com; s=arc-20160816; b=SJQXG3VNaQ84sN9Qq2A0G1T+OmriZxHXO12hW+S3ncGoYI2QJvtZ8h1atVEoD9746x 28Nws2x3maQGw3MiNM7soJA96YvsxlPUEjrDMDtJK2SaTWX2hKD0hysa3gurrZr0lFke 9T0N3vDDBZwPW3HbA3Rz5r9MTvf40T1uT2dYsT8baTuoRRmy68QaL/Y8OhCj00tquXrh hnxZt49eAy7OpUYmxKj9Db8WDUMTA1SFhHAM3ykZzhYy0yr6u3V76ZIXfijchS1UyIfi dANXMXd/A+2latlKjWUQsNoFYccxGiY8hkcozWXlJVxsELUuzH1HN1XoHb4qXNiIuBUM 6GqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u+QEUF6JxPZC6iA8/iTQbNfD/0f/cIFBsSvuzS4gYXg=; b=OxUOoTjtECLCQPFe8+wmcNk7nYWsxN+s3spHz7s6SMgYq2kKx7VWwWgyVDKZU731D+ F725G2/6S9mzIKm2d3daMj8rCqnKBa3vyUHryfHNQ1Dq1c5cUAkJFvsjIwsPIDxzydw6 7VlnoSglkoIliiDY7qzehkjTBdwdNSxnQOQHzXpjuyGYKQ1WTL949tg1+Rec66M8PkrI rkvzT6iCFQ3YM/1ctgyQl3BXi8vA/1FYmSB75bVdxPX6cbzumtLUEwbD2CJzWgqCzpDT R0A9rNjdbUNA/HBvrIitrwFLgJZZwU1nenku8evquKAfUTxeozqoZ3Y+NOVNYY9hAH40 raCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="XtQE/4T8"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js6si1219670ejc.22.2022.01.12.23.50.44; Wed, 12 Jan 2022 23:51:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="XtQE/4T8"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbiAMD1K (ORCPT + 99 others); Wed, 12 Jan 2022 22:27:10 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40884 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbiAMD07 (ORCPT ); Wed, 12 Jan 2022 22:26:59 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20D2v4vg023436; Thu, 13 Jan 2022 03:26:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=u+QEUF6JxPZC6iA8/iTQbNfD/0f/cIFBsSvuzS4gYXg=; b=XtQE/4T8M4KjLAx/4OxsOfawtJVZyVaD0WxBKQMezj8PQAavGWMJQxUkReiNXt56sLii PfeT7/JXOVwf9xUMNnBdhPhe+bNJgz0xzEFeshdKCnijHkrumqGKlPtYxUTgXPjBGx6Z gBZK5he/wr8W50biRFwdFSHMZBgijgmlwKl8UuIO2If4In6yyWYVMJ1aMKpcYF1uM0ks i0RCilQlDCtNzesTep/QXDiSinUvLHJ8YM/m85B08Wo+vDI3rhATar0GsrbAU5PyWhv1 MAFCauquB7LPo3PKt2hqJMqQjqR2BFbrLVa6Jcl47TUIdbHieSO1VbxoYtSW7p+JLh+y qg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3djbrd0du2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jan 2022 03:26:54 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20D3KYZ7030896; Thu, 13 Jan 2022 03:26:53 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3djbrd0dtp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jan 2022 03:26:53 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20D3D3dU015847; Thu, 13 Jan 2022 03:26:52 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 3df289gnhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jan 2022 03:26:51 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20D3QneS38928886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jan 2022 03:26:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1BAC4C040; Thu, 13 Jan 2022 03:26:49 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43E144C046; Thu, 13 Jan 2022 03:26:49 +0000 (GMT) Received: from localhost (unknown [9.43.54.234]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Jan 2022 03:26:49 +0000 (GMT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Andreas Dilger , tytso@mit.edu, Eric Whitney , Ritesh Harjani Subject: [PATCH 6/6] jbd2: No need to use t_handle_lock in jbd2_journal_wait_updates Date: Thu, 13 Jan 2022 08:56:29 +0530 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vDTacn3arfhFYTN4g9wigMBgqbRm2c7o X-Proofpoint-GUID: GG_NpRVXjvDE-FV8jb9gZ-oUeUi6fQo1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-13_01,2022-01-11_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 bulkscore=0 mlxlogscore=776 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201130013 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Since jbd2_journal_wait_updates() uses waitq based on t_updates atomic_t variable. So from code review it looks like we don't need to use t_handle_lock spinlock for checking t_updates value. Hence this patch gets rid of the spinlock protection in jbd2_journal_wait_updates() Signed-off-by: Ritesh Harjani --- include/linux/jbd2.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 34b051aa9009..9bef47622b9d 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1768,22 +1768,18 @@ static inline void jbd2_journal_wait_updates(journal_t *journal) if (!commit_transaction) return; - spin_lock(&commit_transaction->t_handle_lock); while (atomic_read(&commit_transaction->t_updates)) { DEFINE_WAIT(wait); prepare_to_wait(&journal->j_wait_updates, &wait, TASK_UNINTERRUPTIBLE); if (atomic_read(&commit_transaction->t_updates)) { - spin_unlock(&commit_transaction->t_handle_lock); write_unlock(&journal->j_state_lock); schedule(); write_lock(&journal->j_state_lock); - spin_lock(&commit_transaction->t_handle_lock); } finish_wait(&journal->j_wait_updates, &wait); } - spin_unlock(&commit_transaction->t_handle_lock); } /* -- 2.31.1