From patchwork Fri Sep 23 00:24:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9347235 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 7ACE7607EE for ; Fri, 23 Sep 2016 00:24:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 703D52AD20 for ; Fri, 23 Sep 2016 00:24:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64D262AD23; Fri, 23 Sep 2016 00:24:45 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 062552AD20 for ; Fri, 23 Sep 2016 00:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965275AbcIWAYl (ORCPT ); Thu, 22 Sep 2016 20:24:41 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34309 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964947AbcIWAYf (ORCPT ); Thu, 22 Sep 2016 20:24:35 -0400 Received: by mail-pa0-f43.google.com with SMTP id wk8so34098764pab.1 for ; Thu, 22 Sep 2016 17:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=NAvNI59BNNR/7z4bdUThoYLdweO+XaCgllfG3Up/ceg=; b=WtHH0eInY++QlYS+8Bt9pYUXMvOBmi/QQSkbNHU6x9YWNwEC1YvhM90NZp5KRwPVDn 3twyAN8kZoFQX+uRJJWDFQ5kQH4SwDjl+DUaWrLPqisJlTDX5uiQ7CoUtmJf4sB70y4a yRZN47DynaKDTWnndSZkZo16qhysNXkBgRlfLbVV7Osi5ffM93DfmGCGg6wC/BM1YBEO PXDhFZMeF1tizwNpFIY415J3l+BzVZXbbX1Vpl7oUGnyMB0lCO5lkje3Bk3sbdqUJmNp oT2YqyXVUHk4bFQpU6z3YjFOGvTps9YYQjDZ5fOHXsXgMcM1lhlwvwure9dgQhK7AN5j nTSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=NAvNI59BNNR/7z4bdUThoYLdweO+XaCgllfG3Up/ceg=; b=TF6ZNMdKZ2miachktqFN7QYB6rQwWHRrob+GELoHcoTYB9z2s4q/vQ8hoPjy/t1deE r7Sw+56BEjHi6OkAF8hT6cTBWg5FVOgWpaXOSPoXjlS1QhyP6pzhC7hLam84TkiYVNtQ /pu9CXDZHVl2DooqZywgunjJS4D1g+URHJF/z5MAsYErwoYJRalPYU0tTQfTBhUu+pk8 i2C5d1vvl7A4WHgBKM0Log5rX2H2WTO65waVAq/bt3lVQyrmih+nWwcvObhbCUQg1IpV NlHTSTMFfnWx1ldZkq/23yUQ4tLWEq6CDcybeaz1kaeHX/b+PSFy0rMCRpxr1M52Lg12 9RRQ== X-Gm-Message-State: AE9vXwO8UZ9oJYx0erXZBMY7fJFHK+bd5b0KpwTS7hz7o0/b4ql7rb/+3LaXH/pGj1gcffni X-Received: by 10.66.26.207 with SMTP id n15mr7805842pag.69.1474590274981; Thu, 22 Sep 2016 17:24:34 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::6:58ae]) by smtp.gmail.com with ESMTPSA id i8sm6586299paw.25.2016.09.22.17.24.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 17:24:34 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com, Chandan Rajendra , Anatoly Pugachev Subject: [PATCH v2 6/6] Btrfs: use less memory for delalloc sanity tests Date: Thu, 22 Sep 2016 17:24:25 -0700 Message-Id: X-Mailer: git-send-email 2.10.0 In-Reply-To: <218563982dbe4387c60909eeb0add6914a20f813.1474580472.git.osandov@fb.com> References: <218563982dbe4387c60909eeb0add6914a20f813.1474580472.git.osandov@fb.com> In-Reply-To: References: 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 From: Omar Sandoval test_find_delalloc() allocates 256 MB worth of pages. That's all of the RAM that my MIPS emulator has, so it ends up panicking after it OOM kills everything. We don't actually need to use that much for this test. Signed-off-by: Omar Sandoval --- fs/btrfs/tests/extent-io-tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/tests/extent-io-tests.c b/fs/btrfs/tests/extent-io-tests.c index caad80b..ea9c91b 100644 --- a/fs/btrfs/tests/extent-io-tests.c +++ b/fs/btrfs/tests/extent-io-tests.c @@ -73,8 +73,8 @@ static int test_find_delalloc(u32 sectorsize) struct page *page; struct page *locked_page = NULL; unsigned long index = 0; - u64 total_dirty = SZ_256M; - u64 max_bytes = SZ_128M; + u64 total_dirty = sectorsize * 256; + u64 max_bytes = total_dirty >> 1; u64 start, end, test_start; u64 found; int ret = -EINVAL; @@ -138,7 +138,7 @@ static int test_find_delalloc(u32 sectorsize) * |--- delalloc ---| * |--- search ---| */ - test_start = SZ_64M; + test_start = max_bytes >> 1; locked_page = find_lock_page(inode->i_mapping, test_start >> PAGE_SHIFT); if (!locked_page) { @@ -226,7 +226,7 @@ static int test_find_delalloc(u32 sectorsize) * range we want to find. */ page = find_get_page(inode->i_mapping, - (max_bytes + SZ_1M) >> PAGE_SHIFT); + (max_bytes + PAGE_SIZE) >> PAGE_SHIFT); if (!page) { test_msg("Couldn't find our page\n"); goto out_bits;