From patchwork Wed Oct 3 20:52:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 1543251 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 980D43FD9C for ; Wed, 3 Oct 2012 20:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061Ab2JCUxU (ORCPT ); Wed, 3 Oct 2012 16:53:20 -0400 Received: from mx1.fusionio.com ([66.114.96.30]:53800 "EHLO mx1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753736Ab2JCUxT (ORCPT ); Wed, 3 Oct 2012 16:53:19 -0400 X-ASG-Debug-ID: 1349297569-03d6a555912ff970001-6jHSXT Received: from mail1.int.fusionio.com (mail1.int.fusionio.com [10.101.1.21]) by mx1.fusionio.com with ESMTP id 5xRHSB0iGBUrrZI0 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Wed, 03 Oct 2012 14:52:49 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (24.211.209.217) by mail.fusionio.com (10.101.1.19) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 3 Oct 2012 14:52:48 -0600 Date: Wed, 3 Oct 2012 16:52:47 -0400 From: Josef Bacik To: =?iso-8859-1?B?Suly9G1l?= Poulin CC: linux-btrfs Subject: Re: Out of memory condition Message-ID: <20121003205247.GO2370@localhost.localdomain> X-ASG-Orig-Subj: Re: Out of memory condition References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2011-07-01) X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1349297569 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.0177 1.0000 -1.9057 X-Barracuda-Spam-Score: -1.91 X-Barracuda-Spam-Status: No, SCORE=-1.91 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.110324 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, Oct 03, 2012 at 08:25:11AM -0600, Jérôme Poulin wrote: > I don't know how to diagnose the problem, but now it is the second > time. After starting a VM in VirtualBox and filling the memory, Chrome > stopped loading any pages. After logging out and on, it still wasn't > working, reboot fixed it. > > This time, I've had the same problem and took the backtrace. Chrome > starts but doesn't load any pages, I guess it is stuck reading a file > as many chrome process are in state 'Ds' but are still killable, > Chrome seems really hard to strace bu anyway strace freezes in D state > too when attached to a running process. > > The whole filesystem is BTRFS. > Can you give this a try please? Thanks, Josef --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 43d1c5a..36eb5f2 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -577,6 +577,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, u64 em_start; struct extent_map *em; int ret = -ENOMEM; + int faili = 0; u32 *sums; tree = &BTRFS_I(inode)->io_tree; @@ -626,8 +627,11 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, for (pg_index = 0; pg_index < nr_pages; pg_index++) { cb->compressed_pages[pg_index] = alloc_page(GFP_NOFS | __GFP_HIGHMEM); - if (!cb->compressed_pages[pg_index]) + if (!cb->compressed_pages[pg_index]) { + faili = pg_index - 1; + ret = -ENOMEM; goto fail2; + } } cb->nr_pages = nr_pages; @@ -713,8 +717,10 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, return 0; fail2: - for (pg_index = 0; pg_index < nr_pages; pg_index++) - free_page((unsigned long)cb->compressed_pages[pg_index]); + while (faili >= 0) { + __free_page(cb->compressed_pages[pg_index]); + faili--; + } kfree(cb->compressed_pages); fail1: