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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1D304C433DF for ; Fri, 29 May 2020 02:44:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 002832075F for ; Fri, 29 May 2020 02:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391606AbgE2CoM (ORCPT ); Thu, 28 May 2020 22:44:12 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52229 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391576AbgE2CoL (ORCPT ); Thu, 28 May 2020 22:44:11 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 04T2i1qi019181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 May 2020 22:44:02 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 49FCB420304; Thu, 28 May 2020 22:44:01 -0400 (EDT) Date: Thu, 28 May 2020 22:44:01 -0400 From: "Theodore Y. Ts'o" To: Jan Kara Cc: linux-ext4@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/2] jbd2: Avoid leaking transaction credits when unreserving handle Message-ID: <20200529024401.GH228632@mit.edu> References: <20200520133119.1383-1-jack@suse.cz> <20200520133119.1383-3-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520133119.1383-3-jack@suse.cz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, May 20, 2020 at 03:31:19PM +0200, Jan Kara wrote: > When reserved transaction handle is unused, we subtract its reserved > credits in __jbd2_journal_unreserve_handle() called from > jbd2_journal_stop(). However this function forgets to remove reserved > credits from transaction->t_outstanding_credits and thus the transaction > space that was reserved remains effectively leaked. The leaked > transaction space can be quite significant in some cases and leads to > unnecessarily small transactions and thus reducing throughput of the > journalling machinery. E.g. fsmark workload creating lots of 4k files > was observed to have about 20% lower throughput due to this when ext4 is > mounted with dioread_nolock mount option. > > Subtract reserved credits from t_outstanding_credits as well. > > CC: stable@vger.kernel.org > Fixes: 8f7d89f36829 ("jbd2: transaction reservation support") > Reviewed-by: Andreas Dilger > Signed-off-by: Jan Kara Thanks, applied. - Ted