Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1237295imc; Mon, 11 Mar 2019 09:16:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqznUyGzAXPS/T0mJtoOtR3MXMD0CxCR55DQKQM6FVwRr73TvO8On00Djfxl2+XYf+Uy9R0d X-Received: by 2002:a65:6546:: with SMTP id a6mr31034715pgw.296.1552320970733; Mon, 11 Mar 2019 09:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552320970; cv=none; d=google.com; s=arc-20160816; b=r+HBLzrhJOLDfxUps/S+4xK4u5y1aGO+jBgyzqZNvlkaJO+3vgsQZkySHG9iDKejNp 5Zb6PKxDdV29Szu1xq26Ii7bz44yigR0VMyGBNpCP0JBSRjazomrgLvgOOUSFKqlNLzw Kin9j+q+o8mduBtbWjSitny0fkEGnf6ccSYZvEIy62/UYzXPwSNIOhDE6BZ6IHsnOtxX Yy9ii4RlESrWB3nx5r1uM8uGscuZ6TikQ8ukFSJcdDhA+34+IzJlh0pM6Iu0krBwbPeM tvlumZ5wDHLOIBEaRfBWYIZcZojMo0HXRe0y11F5VKnTuC6a78701aojgQ4nDZmGpvzf iZlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OTtpTBY8OcjshatFGmKWZHUbjJqWn4NaZrEAvvAlgZM=; b=rPrJAjKb3VbchBcBpIIfaLuV/Et0wkqApH3B9KwC22hY6NJoPCfxXvnZeugJ0VWoFS Zqxb9CSCuxleFf/++ymTw84jA/4yibXhgaUlFyRGBeJdiC46L1s8kJeMMcEB+OhiJoSm +Z9EK7VL1TEXxbXcTQvcJk5VEOjU0gFwMAo9Mtv1nlqIjI/4ALoIgifiFobMwUocnxbJ cgP5nJ84iODx7EnvcJTS4p0zH0auSf9jH29GK4Z+3s36cWgdBU5wO3qKng8E0Dfj3jav OEsZ51+ycfshlBkcm1zgS15PXQggxDZdahy3wcsgEiZZf6H5DL+xiF6VWUAUjPC1ublO NPLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si5526635plk.126.2019.03.11.09.15.54; Mon, 11 Mar 2019 09:16:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727534AbfCKQP2 (ORCPT + 99 others); Mon, 11 Mar 2019 12:15:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:50690 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726625AbfCKQP2 (ORCPT ); Mon, 11 Mar 2019 12:15:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2F065AE03; Mon, 11 Mar 2019 16:15:27 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id C93871E426A; Mon, 11 Mar 2019 17:15:25 +0100 (CET) Date: Mon, 11 Mar 2019 17:15:25 +0100 From: Jan Kara To: Alexander Lochmann Cc: tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Horst Schirmeier Subject: Re: [PATCH 1/1] Updated locking documentation for struct journal_t Message-ID: <20190311161525.GN11553@quack2.suse.cz> References: <20190308150605.98405-1-alexander.lochmann@tu-dortmund.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190308150605.98405-1-alexander.lochmann@tu-dortmund.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 08-03-19 16:06:05, Alexander Lochmann wrote: > We used LockDoc to derive locking rules for each member > of struct journal_t. Based on those results, we extended > the existing documentation by more members > of struct inode, and updated the existing documentation. > > Signed-off-by: Alexander Lochmann > Signed-off-by: Horst Schirmeier > --- > include/linux/jbd2.h | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) Thanks for the patch! Some comments below. > diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h > index 0f919d5fe84f..c1ba44ca515a 100644 > --- a/include/linux/jbd2.h > +++ b/include/linux/jbd2.h > @@ -585,7 +585,8 @@ struct transaction_s > } t_state; > > /* > - * Where in the log does this transaction's commit start? [no locking] > + * Where in the log does this transaction's commit start? > + * [journal_t->j_state_lock] > */ > unsigned long t_log_start; > > @@ -647,17 +648,17 @@ struct transaction_s > unsigned long t_max_wait; > > /* > - * When transaction started > + * When transaction started [j_state_lock] > */ > unsigned long t_start; > > /* > - * When commit was requested > + * When commit was requested [j_state_lock] > */ > unsigned long t_requested; > > /* > - * Checkpointing stats [j_checkpoint_sem] > + * Checkpointing stats [j_list_lock] > */ > struct transaction_chp_stats_s t_chp_stats; > These look correct to me. > @@ -762,6 +764,7 @@ struct journal_s > > /** > * @j_sb_buffer: The first part of the superblock buffer. > + * [j_checkpoint_mutex] > */ > struct buffer_head *j_sb_buffer; This isn't true. j_sb_buffer is just initialized in journal_init_common() and never changed. So there's no lock protecting it. > @@ -1015,6 +1018,7 @@ struct journal_s > * @j_commit_interval: > * > * What is the maximum transaction lifetime before we begin a commit? > + * [super_block->s_umount] > */ > unsigned long j_commit_interval; Ditto here. > @@ -1032,7 +1036,7 @@ struct journal_s > * @j_revoke: > * > * The revoke table - maintains the list of revoked blocks in the > - * current transaction. > + * current transaction. [j_state_lock] > */ > struct jbd2_revoke_table_s *j_revoke; > This is also not true. The contents of the revoke table itself is protected by j_revoke_lock. The pointer to current revoke table (i.e. j_revoke itself) is changed only when the currently running transation is in T_SWITCH state - a special state where no updates can be happening anymore and new transaction cannot be running yet either. Honza -- Jan Kara SUSE Labs, CR