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.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 33B1BC433FF for ; Thu, 1 Aug 2019 11:29:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08911206B8 for ; Thu, 1 Aug 2019 11:29:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Wjf8pXaw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731033AbfHAL31 (ORCPT ); Thu, 1 Aug 2019 07:29:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45814 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730946AbfHAL31 (ORCPT ); Thu, 1 Aug 2019 07:29:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ksRJLOMTOIWRq2Nag2thMkKvE3lWaLrnStcxxBgysnw=; b=Wjf8pXawCgcKFVf3bV3iZbnJj rX+WDMifwGDiVc6ecMzHbsMT/+jfAGFFMugdHvw6yBSTK2tn/Q2Syt1Nwxm9oCCVHkDM78I/RIZUk 2m7+IzAEQpvn/0rkMsTYP3zgSsxUxl05sRnKRrkqE9q2n46dcLvOao+xLjN4Q3wAYafVTbDxZFd7z UmhJLhJPbpNXPZishSqd2zv3poZ1lQ1U0UsPMZ9mCaz9/iLnd/tJwBaSsLDdYfcOGixo7gWzMT8DD Ff36e4PoTKL35KsJGZCYslDjYcnwWBiXJDap1Co63OVM8uSON30wBYA7ntBMnnquigXHA15H7/BFi cOaFb6Z6w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1ht9GN-0001Zu-6n; Thu, 01 Aug 2019 11:28:51 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9B7432029F4C7; Thu, 1 Aug 2019 13:28:49 +0200 (CEST) Date: Thu, 1 Aug 2019 13:28:49 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: 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: <20190801112849.GB31381@hirez.programming.kicks-ass.net> References: <20190801010126.245731659@linutronix.de> <20190801010944.457499601@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801010944.457499601@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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.