Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1182315pxb; Wed, 10 Feb 2021 02:03:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHjRYV96wZF8aLNvTiJdUUtlvOZm9p4ytS2LRmi/ittr50pyBrR5v+Hr/M8CCJR20aUXfY X-Received: by 2002:a05:6402:d1:: with SMTP id i17mr2387155edu.85.1612951433528; Wed, 10 Feb 2021 02:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612951433; cv=none; d=google.com; s=arc-20160816; b=WWoKstjvCTej17zQbVHg0F2mVR5COruAnwGqoVfYMkm+m7vQU0ZQE0MQaFhk0/iWrs omV9P+cBLy+WdofmT07NjejI6tIKW3NAyUhouAjxQZAClBGH/TlOaxdc1l+tVV00JTsT 4ya37rK+RaJSHyKm7MsWZMac0eeYiyaDcB1W8jw6Ea8/+sTanrVrSUePMzvSBoi16Efh HfW0bpHx58lZ/N8lgFZ387LMTdOK7sCygzGj+fV1ys7cs+uvsaCh8ulMi7J1ZEB9SwPE DdxeVP9msr7QfFpl5CrXJRQSR8IGk6xcKK0hTlwrnNbm763RjcNbuqsSDGM7ghInHAyU WHcg== 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=QcvuOESnx7A1W61y3hw0xl3qNwBU+rBl/jD8JXZbWqY=; b=sqCNobEYaKmg3vP8E6fMkneOdVEmAEK4pxt9all+mG96BIRJQszDRrfrDyw1P5MxX8 owZd50TC4KprT/z43uiKOIRQUnZyIsJpIslE+QvWFjH82P2YGpuO+HypHOz2jKvHVDBz 7dUW3EKhqXGOc8BxQRFwrfrYsFnoDaUhwRuS54KTCtc2tdlAviZNJqoBX5GRDexV0Rk9 /QSGPLlZWosJvP7kfIJYkWZoEnVPuPeoeeOKSnsy/85vpuP5ePqtw5ug4YS7R9Bh22wK W2vGyWfQiQsVo7/w2JUiaLVYpZx9cRBP5lM/mxIzEGR9y9HMgz/pS4SRDEtEkw1L5qw8 P6ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tu-dortmund.de header.s=unimail header.b=XWh3fNWf; 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 s4si932783ejd.603.2021.02.10.02.03.27; Wed, 10 Feb 2021 02:03:53 -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=XWh3fNWf; 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 S229892AbhBJKAx (ORCPT + 99 others); Wed, 10 Feb 2021 05:00:53 -0500 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51]:37286 "EHLO unimail.uni-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbhBJJ6p (ORCPT ); Wed, 10 Feb 2021 04:58:45 -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 11A9vewj028502 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 10 Feb 2021 10:57:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tu-dortmund.de; s=unimail; t=1612951063; bh=qDYD80i6VVMjqchVzfARLfIkNCGcqAw2S45ciOFpyXA=; h=From:To:Cc:Subject:Date; b=XWh3fNWfg362unstw3nQqR5Wpmglb9NItw60VLqKW7h2R07r4zOyglEyV1Y3gXOhe KV3RmLAtxZEaeiaDmWwxq5VIGsq4ifa0FblvDIGVWEnfGZSzo8ll5szQtjhNA9/ueO fuU5ViQhcO3qMTJ9BXRs5NRIq6SpHDy9/u7R3GaU= 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 2/2] Updated locking documentation for journal_t Date: Wed, 10 Feb 2021 10:57:38 +0100 Message-Id: <20210210095740.54881-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 consistency doesn't matter. Based on LockDoc's findings, we extended the locking documentation of those members. Each one of them is marked with a short comment: "no lock for quick racy checks". Signed-off-by: Alexander Lochmann Signed-off-by: Horst Schirmeier --- include/linux/jbd2.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 18f77d9b1745..4dca33a063dd 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -768,7 +768,7 @@ enum passtype {PASS_SCAN, PASS_REVOKE, PASS_REPLAY}; struct journal_s { /** - * @j_flags: General journaling state flags [j_state_lock] + * @j_flags: General journaling state flags [j_state_lock, no lock for quick racy checks] */ unsigned long j_flags; @@ -808,7 +808,7 @@ struct journal_s /** * @j_barrier_count: * - * Number of processes waiting to create a barrier lock [j_state_lock] + * Number of processes waiting to create a barrier lock [j_state_lock, no lock for quick racy checks] */ int j_barrier_count; @@ -821,7 +821,7 @@ struct journal_s * @j_running_transaction: * * Transactions: The current running transaction... - * [j_state_lock] [caller holding open handle] + * [j_state_lock, no lock for quick racy checks] [caller holding open handle] */ transaction_t *j_running_transaction; @@ -1033,7 +1033,7 @@ struct journal_s * @j_commit_sequence: * * Sequence number of the most recently committed transaction - * [j_state_lock]. + * [j_state_lock, no lock for quick racy checks]. */ tid_t j_commit_sequence; @@ -1041,7 +1041,7 @@ struct journal_s * @j_commit_request: * * Sequence number of the most recent transaction wanting commit - * [j_state_lock] + * [j_state_lock, no lock for quick racy checks] */ tid_t j_commit_request; -- 2.20.1