Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp25335pxb; Wed, 30 Mar 2022 21:53:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6k/rKT1cAAvyLjaJIILom7tEmZWbhl/SWl5uIzbAnOFo0PFnP24blCz7skqCsSymGd80k X-Received: by 2002:a62:402:0:b0:4f7:81a3:7c47 with SMTP id 2-20020a620402000000b004f781a37c47mr37046991pfe.9.1648702402973; Wed, 30 Mar 2022 21:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648702402; cv=none; d=google.com; s=arc-20160816; b=tOfcNCajqxfBHQOAqLXXaiI1yOb+/JvVVwkqYwn0O9/+F1Po4DFJdTNcuNVaT5ic+7 hZi4nicSU/zug+xVqsyURLrV7YM+tnmCM52OzCXu9Jipwqqu+zaVWRYa9EqsA/9dtG4Y jD5lNFhaF6amLCqcQvsa2s4rerbQIlnXPihT+LKGStA4QTJyzrUMVJOpJjjrvgbgtc8V 8sSF+qSXMBYT4AtDPFnE4CPWDtektJXmeuCGpSt3ROK20HIAonTHMmPmd2rK7Y28APsa Tl/3yV9YsOARL+na8N+w2aKn1AE6anNU52+VetXojlDKgByR5WoO3ffiBTbzBBS4oJvH bq3Q== 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=0bYIdjkJXORww5U1MLg1qETMQrUj9LFtxDQcF8pXziQ=; b=Wz5Pu3EkL61L9P+awWb/YvORf00t26fqxdTDqzqTs82kJuDriNPo+lAyzywnb32Jt7 VU8/7JK2PA31qbe4DFo6kJgheHsZYTBHyVCGaOBp9cI/pHB2lQMGcTiqKQMQKkyZ/GGF HKYajrT13LHRIB3OZIqPLR+ntvF3orHIyAcczAzj8tMBxj98em9LNgTAwn7g3mnI4YYK XdMu8Bb9jE/NzcZa63Jkv5nv0DQHKGRdNdDpd5hzo7aSpffrox+TQyXmuUsNmt4u6aoq aplOaNZx7RMy3vypwgbKnwVV7c+K63kSIk2loNEZ4/CL0z7fkMluMcDgIQxpW+ygSM6j 0Hhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (bad format) header.i=@dorminy.me header.s=mail header.b=oWyNYac1; 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 i15-20020a170902c94f00b00153f163b3d3si24704993pla.26.2022.03.30.21.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:53:22 -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=oWyNYac1; 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 DA5A721DF32; Wed, 30 Mar 2022 20:33:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348922AbiC3QqJ (ORCPT + 99 others); Wed, 30 Mar 2022 12:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244129AbiC3QqF (ORCPT ); Wed, 30 Mar 2022 12:46:05 -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 4EC401D250C; Wed, 30 Mar 2022 09:44:15 -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 DAA17804AF; Wed, 30 Mar 2022 12:44:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dorminy.me; s=mail; t=1648658655; bh=YbODGOZC9RfP7swiMxOJJuEq3TpYTYujQ+9ez6Jjnog=; h=From:To:Cc:Subject:Date:From; b=oWyNYac1DlwozufTA1IliOOikurJt1uIOVk/6oPsVvJvZBFhHHNvqgL/LS3n66KNV 263AWC6mHha2/KTdRytkLggqTpTaSvcuqcYOijGRZ8kpH8uXXxzypzKKLdA097ZTLQ aZTJDLgAhxDM93bE99f22w0Svu9lx2nSsjqfDRKe/OD0adBMPcWI0gwr14xIP0qPdc eHDv1J2InBKXJcIMkfed0qgvJWHzNGYwGGaGa7Ix9Geuxj/NgO/OUEdSdHJhPoUrY/ p+yIFeQBQFf9PODIonrv54uMSnUkTUS4hGQv/3w3rar/TH9Spvy9iZIxb+KZRFYjkT FYtrEzgYplxMg== 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 v2 0/2] btrfs: allocate page arrays more efficiently Date: Wed, 30 Mar 2022 12:44:05 -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. v2: moved new helper to extent_io.[ch]. Fixed title format. 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 | 37 +++++++++----------- fs/btrfs/extent_io.c | 72 +++++++++++++++++++++++++++++--------- fs/btrfs/extent_io.h | 2 ++ fs/btrfs/inode.c | 10 +++--- fs/btrfs/raid56.c | 30 +++------------- 6 files changed, 85 insertions(+), 74 deletions(-) -- 2.35.1