Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2156847pxb; Thu, 11 Feb 2021 05:58:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhDHrTh9dafFrwlABN0AHDTxcmCrqTycxm3I1YjZaIWy12GRzJ3PE7r3VdHfSzwj479y5G X-Received: by 2002:aa7:d888:: with SMTP id u8mr8363111edq.239.1613051932203; Thu, 11 Feb 2021 05:58:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613051932; cv=none; d=google.com; s=arc-20160816; b=Yj9BqRUAYejR0AI0ErxdNuQbzvsCktImUChI+dCb9F9C4Q/yuSe9RKheQoWiFXuOt8 DoT72yhVCdk4pNwu8BRJi1GLJ3TjlkzK26uRHNEaKl/vfxf4iNRklM0YqOG+fyv6e3wc 64cjbP0cE01K6nzX1qxiX9puLaiaRI8oe2NDufNe4PBrQug77mXru5poIrgRUIUPE//Y PMVddI4hKQm9/r2hTb3bAZlRBl0A9N8f9R704RuDYhTv+Pw4iURdDrJFTIlmQs4kZvim a/9lTUMcO8T0nDXG+sfzh+IOE6mfyxm4U5/vkNGUo7MHbpawBz0HabYcfT+KGez7LFHC yLiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=08bAWFhrq9YSFTvmtBPNyzVO4QyyKGH2s3gUjMVa3r8=; b=eysynjqJXdx2snWzEV/xmh5FOklJuuVC7m5ZvOowDLNBrwPObDai6EqNG+woX9pP48 KJnrMquLhaGGOoq0iQjuBHpyOOV0gyAIrvzzU150c5wnNxMQhdzV585E+R8xxWguaZVu qXznSChoWmaPby9ui+w+5+mxySaT9H2fSl2yUkqbsYrgoODxvM6ykvZNZk5qcHxO/HuA 5Oqojit6NTUdlCtZjC9BO14NDOgjmim1rzn5bZhZ/b8j+SFyz7ikLg1msaI5Sa/9JNPX BSCX6yKtGHS5rBboQF50TnGQhr07W9MTKP59mOzXZybStVw/MWL5Nd922es5lscAwzqa QeGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tu-dortmund.de header.s=unimail header.b=J2kc+h7I; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si4339659edd.431.2021.02.11.05.58.21; Thu, 11 Feb 2021 05:58:52 -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=fail header.i=@tu-dortmund.de header.s=unimail header.b=J2kc+h7I; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230380AbhBKN5d (ORCPT + 99 others); Thu, 11 Feb 2021 08:57:33 -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: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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; - /* 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; /* * 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 thread] */ struct journal_head *t_reserved_list; /* * 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; @@ -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; -- 2.20.1