From patchwork Thu Jul 19 14:49:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10534681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61E3D600D0 for ; Thu, 19 Jul 2018 14:50:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6788729CB7 for ; Thu, 19 Jul 2018 14:50:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C07729CC6; Thu, 19 Jul 2018 14:50:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0972429CB7 for ; Thu, 19 Jul 2018 14:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731846AbeGSPdw (ORCPT ); Thu, 19 Jul 2018 11:33:52 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45253 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731656AbeGSPdv (ORCPT ); Thu, 19 Jul 2018 11:33:51 -0400 Received: by mail-qt0-f193.google.com with SMTP id y5-v6so7395642qti.12 for ; Thu, 19 Jul 2018 07:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=h31C/TfWw4EO5tb0TgNVMm0D5/bA8juhKvUeVKfvltk=; b=A5rdUk6Iuq2HOPRaMR+mTxuHmo5IKGizHqw3H5cPyKeD9sXAov3PkH7BYNGe8uRSKY F4VFzOY3lxJehODtghAPJm8dlKdAFNSpteGQh3BD2OHoJnUzoy5K0i83sHkS5q5QtTGx QdkQM9QgElyOmsFWqWVD+bYmI+pRwiNPetInPMPysF2+wMfJIlEN857lFKwrYOm6XJl6 qs5qjnKiPbpUoty8qN+Hkp7QKLn/V2FQRQWp1kpytXCUuTB0LGIcYCfv6I4tOkLHGQU3 bS/deKhKScoOCMP9AjUvjobE55SUNibSOzvaVeDSSA3um4PE7XBMomIFYf6VN2fDYlux JqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=h31C/TfWw4EO5tb0TgNVMm0D5/bA8juhKvUeVKfvltk=; b=tqKv+rucXtNd/M5EMyn4PTpAUdNU2VLelrk6l4Z+qEiX37G4fVZZWVV+AAR5GaYKxx x1ZrCRJpXevscHVCzt8WR4f4adVlVPanBTbL2AeuqvwaLPeaGOBaYog0ijo91cEOEBRM n30Y1VN0cJX6B9hwJJTdzAVUikJkiXLqH7/yPNE6cRUY/ifkzJ4NzpUxs8GIt0V1GKOt M9nFyuh14rPmw25DsdBeeff1dAWhpdP2E5b0uD4cbo4Op6qAkwPP7hG7RoHVnXBdR1AJ D/2AsNl5ndXJx3cuPOlKMbM1PxveSDOQ8DSraWWtjAx0I2dH+jSr1Zem3eBS0FiBK/bK tAAw== X-Gm-Message-State: AOUpUlHmmMaYgqystLFomxBBG4SKdu+pexgBnc2qAe3pYuMzdyPcP72Q /8xf9h91gPyHNlb/STLm/CEgwG6QKSw= X-Google-Smtp-Source: AAOMgpckOFU7gYBiCVdjyyUvstABDRasYf76XIYZDGEnWTiFpDBoj+1Phx3EIWjWkiC3jEMPGGiwXg== X-Received: by 2002:ac8:709:: with SMTP id g9-v6mr10103743qth.110.1532011819891; Thu, 19 Jul 2018 07:50:19 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id q13-v6sm6321707qkl.97.2018.07.19.07.50.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jul 2018 07:50:19 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 09/22] btrfs: release metadata before running delayed refs Date: Thu, 19 Jul 2018 10:49:53 -0400 Message-Id: <20180719145006.17532-9-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180719145006.17532-1-josef@toxicpanda.com> References: <20180719145006.17532-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We want to release the unused reservation we have since it refills the delayed refs reserve, which will make everything go smoother when running the delayed refs if we're short on our reservation. Signed-off-by: Josef Bacik --- fs/btrfs/transaction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 337397f99c95..4b171d8a7554 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1916,6 +1916,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) return ret; } + btrfs_trans_release_metadata(trans); + trans->block_rsv = NULL; + /* make a pass through all the delayed refs we have so far * any runnings procs may add more while we are here */ @@ -1925,9 +1928,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) return ret; } - btrfs_trans_release_metadata(trans); - trans->block_rsv = NULL; - cur_trans = trans->transaction; /*