From patchwork Wed Jul 30 20:42:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 4651421 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 08CF59F3FF for ; Wed, 30 Jul 2014 20:43:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2312420122 for ; Wed, 30 Jul 2014 20:43:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 289AA2018E for ; Wed, 30 Jul 2014 20:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755919AbaG3Umo (ORCPT ); Wed, 30 Jul 2014 16:42:44 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:39424 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755901AbaG3Umj (ORCPT ); Wed, 30 Jul 2014 16:42:39 -0400 Received: by mail-ig0-f180.google.com with SMTP id l13so3639080iga.13 for ; Wed, 30 Jul 2014 13:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=BmzCKcMQtyPy7dfzXHuYP67xkJpPsIogsbZ2FNA6e7U=; b=S1lFK219v26ejM9MnFXq+nudGDSPJ58dk3Lc0uV6YdvHjGmbJjwrqpoKeg5aXImhTe CHXme/qJsxeyKX9yikB+Zp4LT9uHdIVyaOrH3ZdwYmYgtjgduWXc36gcr6sY0w/Mb4lf sqKRtTTXOTs/sdq6Vk/t89kmH3PQRMPetwg7EHhdOhNkPiudEU/PazEh8DtbBux6cRjs ktpr8VXdxiAmUQPqHQpSxymM++Rwj62p9E8i9mziPIWv72aFU5IJw/FwkS4H+Guue6Zy JsjmXq/GsLRbnqbEC77GRhb79zjRb8/whdA0A3nLFYlvb8wLPpDNKs11tBVpYjYx3HvF nUXw== X-Received: by 10.50.61.140 with SMTP id p12mr11299974igr.41.1406752958960; Wed, 30 Jul 2014 13:42:38 -0700 (PDT) Received: from nick-System-Product-Name.phub.net.cable.rogers.com (CPE0026f3330aca-CM0026f3330ac6.cpe.net.cable.rogers.com. [99.232.64.167]) by mx.google.com with ESMTPSA id x3sm52470515igl.7.2014.07.30.13.42.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Jul 2014 13:42:38 -0700 (PDT) From: Nicholas Krause To: clm@fb.com Cc: jbacik@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Remove certain calls for releasing page cache Date: Wed, 30 Jul 2014 16:42:34 -0400 Message-Id: <1406752954-26158-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch removes the lines for releasing the page cache in certain files as this may aid in perfomance with writes in the compression rountines of btrfs. Please note that this patch has not been tested on my own hardware due to no compression based btrfs volumes of my own. Signed-off-by: Nicholas Krause --- fs/btrfs/compression.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 1daea0b..b55b0e1 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008 Oracle. All rights reserved. * * This program is free software; you can redistribute it and/or @@ -246,7 +247,6 @@ static noinline void end_compressed_writeback(struct inode *inode, u64 start, } for (i = 0; i < ret; i++) { end_page_writeback(pages[i]); - page_cache_release(pages[i]); } nr_pages -= ret; index += ret; @@ -293,21 +293,6 @@ static void end_compressed_bio_write(struct bio *bio, int err) end_compressed_writeback(inode, cb->start, cb->len); /* note, our inode could be gone now */ - - /* - * release the compressed pages, these came from alloc_page and - * are not attached to the inode at all - */ - index = 0; - for (index = 0; index < cb->nr_pages; index++) { - page = cb->compressed_pages[index]; - page->mapping = NULL; - page_cache_release(page); - } - - /* finally free the cb struct */ - kfree(cb->compressed_pages); - kfree(cb); out: bio_put(bio); }