From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9123FC32750 for ; Fri, 2 Aug 2019 13:32:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6939520665 for ; Fri, 2 Aug 2019 13:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405125AbfHBNcY (ORCPT ); Fri, 2 Aug 2019 09:32:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:55568 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405016AbfHBNcV (ORCPT ); Fri, 2 Aug 2019 09:32:21 -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 25141B62C; Fri, 2 Aug 2019 13:32:20 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id F0EE61E433B; Fri, 2 Aug 2019 15:31:54 +0200 (CEST) Date: Fri, 2 Aug 2019 15:31:54 +0200 From: Jan Kara To: Peter Zijlstra Cc: Thomas Gleixner , LKML , Ingo Molnar , Sebastian Siewior , Anna-Maria Gleixner , Steven Rostedt , Julia Cartwright , Jan Kara , Theodore Tso , Mark Fasheh , Joseph Qi , Joel Becker , linux-ext4@vger.kernel.org, Jan Kara , Matthew Wilcox , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [patch V2 6/7] fs/jbd2: Make state lock a spinlock Message-ID: <20190802133154.GM25064@quack2.suse.cz> References: <20190801010126.245731659@linutronix.de> <20190801010944.457499601@linutronix.de> <20190801112849.GB31381@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801112849.GB31381@hirez.programming.kicks-ass.net> 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 Thu 01-08-19 13:28:49, Peter Zijlstra wrote: > On Thu, Aug 01, 2019 at 03:01:32AM +0200, Thomas Gleixner wrote: > > > @@ -1931,7 +1932,7 @@ static void __jbd2_journal_temp_unlink_b > > transaction_t *transaction; > > struct buffer_head *bh = jh2bh(jh); > > > > - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); > > + assert_spin_locked(&jh->state_lock); > > transaction = jh->b_transaction; > > if (transaction) > > assert_spin_locked(&transaction->t_journal->j_list_lock); > > > @@ -2415,7 +2416,7 @@ void __jbd2_journal_file_buffer(struct j > > int was_dirty = 0; > > struct buffer_head *bh = jh2bh(jh); > > > > - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); > > + assert_spin_locked(&jh->state_lock); > > assert_spin_locked(&transaction->t_journal->j_list_lock); > > > > J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); > > > @@ -2500,7 +2501,7 @@ void __jbd2_journal_refile_buffer(struct > > int was_dirty, jlist; > > struct buffer_head *bh = jh2bh(jh); > > > > - J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); > > + assert_spin_locked(&jh->state_lock); > > if (jh->b_transaction) > > assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock); > > > > Do those want to be: > > lockdep_assert_held(&jh->state_lock); > > instead? The difference is of course that lockdep_assert_held() requires > the current context to hold the lock, where assert_*_locked() merely > checks _someone_ holds it. Yeah, jbd2 doesn't play any weird locking tricks so lockdep_assert_held() is fine. I'll replace those when I'm updating the patch. Honza -- Jan Kara SUSE Labs, CR