From nobody Sat May 10 20:49:18 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1613052778; cv=none; d=zohomail.com; s=zohoarc; b=gBeAnAG2/czKr5yqFowfIU4YzvI3Z9CgoYZmmgo6nhK/FTcjA2QdYqTz1u+qMI51cJT+9kGySr5uWv95pmqOrqpQzr+oc5ddFk079yTibBMsAxNR1q6MY/1HLs11AsS7HIbd35PdvYPHDt3RSxrujdoJ2gVUri/aIlMuqQjBnwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613052778; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:MIME-Version:Message-ID:Subject:To; bh=08bAWFhrq9YSFTvmtBPNyzVO4QyyKGH2s3gUjMVa3r8=; b=CV5nKJPzXUpMUzgo7CvjCv0CqMWS1kHbbP91piKeIFcIzHAVMC5v1oSwSQTQtGp4gsGACcksZYql/alCnncFLmvYBpXawHEQuM8yUALKLzdq61+s7BmlqdujfbChVSjCTl5YnI0vas6m+7wtdb3qCqDWnAVQKWZcFRsn8xMjD8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1613052777344386.09445285338813; Thu, 11 Feb 2021 06:12:57 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232158AbhBKOMm (ORCPT ); Thu, 11 Feb 2021 09:12:42 -0500 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51]:61956 "EHLO unimail.uni-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbhBKNzw (ORCPT ); Thu, 11 Feb 2021 08:55:52 -0500 Received: from ios.cs.uni-dortmund.de (ios.cs.uni-dortmund.de [129.217.43.100]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.1/8.16.1) with ESMTPSA id 11BDsTww027233 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 11 Feb 2021 14:54:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1613051672; bh=gjOUwmU1t+wKdLBsPCfx+1FQK3F1VEP+faTt8VFJuks=; h=From:To:Cc:Subject:Date; b=J2kc+h7IwBue0pyKD5g3D5fOhDM3drVXAeknfJBJsPIwLtFm12gnG/OqTQ02vRLh2 lx4+bWZ0Ldcevm/UIYZUn5Yun6oQ+jY0nprMUdI7wo3cTc0PlTjcs0AF1VXXjtxSKS s5wrg25DgIr4Dtasm/nYrrvhSgd7PkRyiMM6QpvE= From: Alexander Lochmann Cc: Alexander Lochmann , Horst Schirmeier , "Theodore Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] Updated locking documentation for transaction_t Date: Thu, 11 Feb 2021 14:54:23 +0100 Message-Id: <20210211135424.42826-1-alexander.lochmann@tu-dortmund.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Some members of transaction_t are allowed to be read without any lock being held if accessed from the correct context. We used LockDoc's findings to determine those members. Each member of them is marked with a short comment: "no lock needed for jbd2 thread". Signed-off-by: Alexander Lochmann Signed-off-by: Horst Schirmeier --- include/linux/jbd2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 99d3cd051ac3..1f19d19f6435 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -594,18 +594,18 @@ struct transaction_s */ unsigned long t_log_start; =20 - /* Number of buffers on the t_buffers list [j_list_lock] */ + /* Number of buffers on the t_buffers list [j_list_lock, no locks needed = for jbd2 thread] */ int t_nr_buffers; =20 /* * Doubly-linked circular list of all buffers reserved but not yet - * modified by this transaction [j_list_lock] + * modified by this transaction [j_list_lock, no locks needed for jbd2 th= read] */ struct journal_head *t_reserved_list; =20 /* * Doubly-linked circular list of all metadata buffers owned by this - * transaction [j_list_lock] + * transaction [j_list_lock, no locks needed for jbd2 thread] */ struct journal_head *t_buffers; =20 @@ -631,7 +631,7 @@ struct transaction_s /* * Doubly-linked circular list of metadata buffers being shadowed by log * IO. The IO buffers on the iobuf list and the shadow buffers on this - * list match each other one for one at all times. [j_list_lock] + * list match each other one for one at all times. [j_list_lock, no locks= needed for jbd2 thread] */ struct journal_head *t_shadow_list; =20 --=20 2.20.1