From patchwork Mon Jun 10 12:59:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2697501 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 280103FD4E for ; Mon, 10 Jun 2013 12:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509Ab3FJM7I (ORCPT ); Mon, 10 Jun 2013 08:59:08 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:60987 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124Ab3FJM7H (ORCPT ); Mon, 10 Jun 2013 08:59:07 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id CA1389A0368 for ; Mon, 10 Jun 2013 06:59:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1370869146; bh=y1dpR9kjjr9HMINihDYe1GLcA1GpxailWsxLYTvzDj0=; h=From:To:Subject:Date; b=Lpkxjiq8Wlb+3zIis+Hmv3Kc/r53H5iEMcpQajQt3Dfc6kxiQTikQPq9FylBMeurN a9bFreaIXGqFucx8pf8a8mZT31/yEjvTqio3op7olwk/U1j7hqkIjxDqW745U6ytTa 75isS8H+GJkcmzioszI0rifxGwQlj+4y4veHSee8= X-ASG-Debug-ID: 1370869146-03d6a573793b7850001-6jHSXT Received: from mail1.int.fusionio.com (mail1.int.fusionio.com [10.101.1.21]) by mx1.fusionio.com with ESMTP id kUWNkHsihDDt7YVH (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 10 Jun 2013 06:59:06 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (76.182.72.146) by mail.fusionio.com (10.101.1.19) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 10 Jun 2013 06:59:05 -0600 From: Josef Bacik To: Subject: [PATCH] Btrfs: free csums when we're done scrubbing an extent Date: Mon, 10 Jun 2013 08:59:04 -0400 X-ASG-Orig-Subj: [PATCH] Btrfs: free csums when we're done scrubbing an extent Message-ID: <1370869144-1524-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1370869146 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.133505 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org A user reported scrub taking up an unreasonable amount of ram as it ran. This is because we lookup the csums for the extent we're scrubbing but don't free it up until after we're done with the scrub, which means we can take up a whole lot of ram. This patch fixes this by dropping the csums once we're done with the extent we've scrubbed. The user reported this to fix their problem. Thanks, Reported-and-tested-by: Remco Hosman Signed-off-by: Josef Bacik --- fs/btrfs/scrub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index d485055..63144e4 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2499,6 +2499,7 @@ again: if (ret) goto out; + scrub_free_csums(sctx); if (extent_logical + extent_len < key.objectid + bytes) { logical += increment;