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.2 required=3.0 tests=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 EA54CCA9EC0 for ; Mon, 28 Oct 2019 15:29:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9F6E21783 for ; Mon, 28 Oct 2019 15:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbfJ1P3D (ORCPT ); Mon, 28 Oct 2019 11:29:03 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57600 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727381AbfJ1P3D (ORCPT ); Mon, 28 Oct 2019 11:29:03 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-98.corp.google.com [104.133.0.98] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x9SFS8nn015744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2019 11:28:09 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id A377F420456; Mon, 28 Oct 2019 11:28:08 -0400 (EDT) Date: Mon, 28 Oct 2019 11:28:08 -0400 From: "Theodore Y. Ts'o" To: Jan Kara Cc: linux-ext4@vger.kernel.org, Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Steven Rostedt , Anna-Maria Gleixner , Julia Cartwright Subject: Re: [PATCH 5/7] jbd2: Don't call __bforget() unnecessarily Message-ID: <20191028152808.GB4404@mit.edu> References: <20190809124233.13277-1-jack@suse.cz> <20190809124233.13277-6-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190809124233.13277-6-jack@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Aug 09, 2019 at 02:42:31PM +0200, Jan Kara wrote: > @@ -1660,10 +1660,9 @@ int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh) > __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); > spin_unlock(&journal->j_list_lock); > } > - > +drop: > jbd_unlock_bh_state(bh); > __brelse(bh); > -drop: > if (drop_reserve) { > /* no need to reserve log space for this block -bzzz */ > handle->h_buffer_credits++; (Workflow observation: this is an example where Gerrit can be *so* *much* *better* than e-mail review at times; sometimes, you *really* want to see more context than what e-mail affords you.) After this patch, the resulting code looks like this: ----- drop: jbd_unlock_bh_state(bh); __brelse(bh); if (drop_reserve) { /* no need to reserve log space for this block -bzzz */ handle->h_buffer_credits++; } return err; not_jbd: jbd_unlock_bh_state(bh); __bforget(bh); goto drop; ---- And we still have a case we jump to not_jbd, at which point hilarity will ensue. This is cleaned up in the following patch in this sequence, but this leaves us in a not-great state if we are ever bisecting. - Ted