Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2315150pxb; Thu, 11 Feb 2021 09:17:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsDFnOVA683Do9724TwOWCg3dF6P1Jp100KBZzEwA1p0EQFRkak5sK9p5Q67qEdbv9UT9b X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr8944186edv.131.1613063866591; Thu, 11 Feb 2021 09:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613063866; cv=none; d=google.com; s=arc-20160816; b=RzqZ7pPj8oUk1Pla9GR4oKcS2EtWKiH0LAlmXuOZrVz01DEVZUkQlM3hkD+d2Fd7BW srJLvPuZYTLFIoGVcTZl2PP1IqFKKPhsCH7wEludA9l6OnKj3a46+9x/COBJ7TyNcwil Ou5LvmLIvX9dIdCj+CzGG8xK4kEYkpsucesXxU3buibPs6qrl37dP9Xc/2ZNDII5Y4Pa w9eDxXPowdvmHJhqbQKZJvmLRLVsnolTF5p51jpn25YF9WIEmHVTHMBhEadfXEvZUXyP Dd7ISW7H+swLqriCeEjXgMWtsVjH0LNa83HHq2DXe9E1mgYTfuyUyXZbnbCiLc+Z9kgl fLtg== 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=q3llpKj1nnf958F/GH6vu9RzZdtTkHB87tPek726dV8=; b=eah2tVSx4mW8k1aBqlNrG5BThE6eUMIa0xeCOyWn2J/s1k5GTFWZsU1sfZUUM3eCCI wPjJnjJ/jv4V809UD/0XTc3ktslVP/3bQ+WVjxIxEEH2HS/B/h1yysD5EWTGk86REQAl +oGpyWOJzUBkdTr7ed9ujopyyW4oHmhPUKqh86g1hxr9GRuafd9fQJ4q+VKv0VC0R/+X W5es5nfwoK91SY12AZM207Dl7SG5GubM9KsAxMOqm3CsFbhHUhSUJCvz7DYj26qQBpAO 6oHxVXGTxdOt9Roht/ooI2BrFy+WFzaT53k0zTiSF36pSE4MriPzlRxHS/fypNl1pV/o RMJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tu-dortmund.de header.s=unimail header.b=BviBf1zE; 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 cc7si4305202edb.462.2021.02.11.09.16.57; Thu, 11 Feb 2021 09:17:46 -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=BviBf1zE; 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 S231377AbhBKRQq (ORCPT + 99 others); Thu, 11 Feb 2021 12:16:46 -0500 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51]:50985 "EHLO unimail.uni-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231815AbhBKRPF (ORCPT ); Thu, 11 Feb 2021 12:15:05 -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 11BHEAdV016868 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 11 Feb 2021 18:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1613063654; bh=cRlXnHwY14ELXw7p0vlEY02Qm8KGsrh+EUzurnNU9XM=; h=From:To:Cc:Subject:Date; b=BviBf1zEby2NRW00ZsPsL8NdDjK72d8zQmzJY+HU/k4tSZ7n5Zl2hYKpfGHhyvA/V nhY41Y15aPIlIoSUrBhZ0BxB8tC1CbyF6BSKkNyLcStwbZldSWQTzEGwJbA1HWkg2/ g5oYU/d7kwHN0OSY9ja3uqmMnguOkwviRJ2Z7gVc= From: Alexander Lochmann Cc: Alexander Lochmann , Horst Schirmeier , Jan Kara , "Theodore Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] Updated locking documentation for transaction_t Date: Thu, 11 Feb 2021 18:14:10 +0100 Message-Id: <20210211171410.17984-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 Reviewed-by: Jan Kara --- 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