Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp15708pxb; Wed, 30 Mar 2022 21:32:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEFhSQxlegbfTJUW8UtIV1pXm71FsitfBOM8dl3m8DkXMAalzCa08pggRPERtyDbakc59W X-Received: by 2002:a17:903:1204:b0:156:29c3:d9d with SMTP id l4-20020a170903120400b0015629c30d9dmr3530763plh.28.1648701140307; Wed, 30 Mar 2022 21:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648701140; cv=none; d=google.com; s=arc-20160816; b=l0dbnBNVMwK1X2g4sVzrpEDGuu8cQLIwWdY5wxOj6hXg4iivWZsONxOmxxnWqH6g5v bdWHcCWmJ+LyNrFY+QqCC1DeNSp9UQY7lYqu0Y5jLXozI1BzIlw4298QTydYg0m3mmMd 2/EjqdUQRjqHzOwQYJkWaSdbc8Q9/f/2k3nUntz6ccI5mJPrZ9FlKd3SYOU3Q+/F22dC uKwQVlLxmEI3D/EpVKDK4BG+KyTjqXVTQzqfDlRyvMopkneXBAR3jFRdShu5B6dNroa2 SsUJAsYxYm+iQir47BTdagm8BDr1eIJo+0WCApRylmpA3eBWf3qlWe88iKF0WyY35FP6 fa8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jrdWObStYPbwCuCg/a/N92FMhkqVUaEvvKwGmDgoqps=; b=yvPLWehsDDB24mh83S++9ZuDiVPV3nuZWvGanSgGdmzfFIpMXz498Cb/xQ4jNRn/lz BUZresvq8mIhf5p0mLBhqbfXEEDCaD7SGUDnkYfefFSYg0lVJ5ssTWKRSWtk3tmm6/VK NdjbwTcIcPz0zWZzTtZTNCNaStp7P04fenE6oN+wDVf1rGYs0TDfaJbq+sfJuYPjvSAi 8UT1DdsFEqVXn4bbvRKprd1X2pYWEz3KsOaENVfmGcwomxGfoWoHHPT16VeNuxzN2fce pTRQdo0zaxkqUb/czaD4l/At3vbP8/WkANhlzQ7FR7TaTwHbv/SHhWzX30NJv9Q2+tsM yk7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (bad format) header.i=@dorminy.me header.s=mail header.b=qzv8escI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dorminy.me Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oc14-20020a17090b1c0e00b001c685d1da8csi2479021pjb.25.2022.03.30.21.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:32:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=neutral (bad format) header.i=@dorminy.me header.s=mail header.b=qzv8escI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dorminy.me Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 49A281D97D9; Wed, 30 Mar 2022 20:25:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231785AbiC3UNR (ORCPT + 99 others); Wed, 30 Mar 2022 16:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231563AbiC3UNM (ORCPT ); Wed, 30 Mar 2022 16:13:12 -0400 Received: from box.fidei.email (box.fidei.email [IPv6:2605:2700:0:2:a800:ff:feba:dc44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBDA06542E; Wed, 30 Mar 2022 13:11:26 -0700 (PDT) Received: from authenticated-user (box.fidei.email [71.19.144.250]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.fidei.email (Postfix) with ESMTPSA id 64E53804E2; Wed, 30 Mar 2022 16:11:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dorminy.me; s=mail; t=1648671086; bh=n0wWn1phLt+ulqPA8UStyX7a3bb5zuBWc1xXikWnhUc=; h=From:To:Cc:Subject:Date:From; b=qzv8escIqyeYmf/blTE/TtUim9RqDN8gCUGYdfE7oD190++EzK8c3D7bFGmCSIhZN fX1m+JyUlb2Lz2/yWKH1/pzuulnXc9W2wsOSKAbl4posVkEEjVKjOMfjEkNnhMqg7k rydwolY7jdbyfDQenhTGOgpI6PPwOzXTYTzDeIJmHb4VvU4P6wumS9P66DZi26PEdO dYY5GPZ9jr0otmB33Cddel/LL5qKEaB+UPKXd2Gdw31SG72IgG6FrULJFNQlil5Q1U 8QzrmrxW6H7KyDjgY6g1A5ZGJcJPFdPWuOU+vi8kS5fESgOwbZnKpJfMrsKKKJI4K1 1FY2RBqOVxlxg== From: Sweet Tea Dorminy To: Chris Mason , Josef Bacik , David Sterba , Nick Terrell , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Sweet Tea Dorminy Subject: [PATCH v3 0/2] btrfs: allocate page arrays more efficiently Date: Wed, 30 Mar 2022 16:11:21 -0400 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In several places, btrfs allocates an array of pages, one at a time. In addition to duplicating code, the mm subsystem provides a helper to allocate multiple pages at once into an array which is suited for our usecase. In the fast path, the batching can result in better allocation decisions and less locking. This changeset first adjusts the users to call a common array-of-pages allocation function, then adjusts that common function to use the batch page allocator. v3: - fixed up the other style comments from kdave's v1 comments v2: - moved new helper to extent_io.[ch]; fixed title format - https://lore.kernel.org/linux-btrfs/cover.1648658235.git.sweettea-kernel@dorminy.me/ v1: - https://lore.kernel.org/linux-btrfs/cover.1648496453.git.sweettea-kernel@dorminy.me/ Sweet Tea Dorminy (2): btrfs: factor out allocating an array of pages btrfs: allocate page arrays using bulk page allocator fs/btrfs/check-integrity.c | 8 ++--- fs/btrfs/compression.c | 39 +++++++++------------ fs/btrfs/extent_io.c | 71 +++++++++++++++++++++++++++++--------- fs/btrfs/extent_io.h | 2 ++ fs/btrfs/inode.c | 10 +++--- fs/btrfs/raid56.c | 30 +++------------- 6 files changed, 85 insertions(+), 75 deletions(-) -- 2.35.1