Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2221677pxb; Wed, 30 Mar 2022 19:48:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFezomaCOQPlghm6aekfxMUxeCyMl/9aH2Xo/fiV7D8p14EuQQAMmlrlMtTSRyyxcbrkMb X-Received: by 2002:a63:416:0:b0:386:66e:33d9 with SMTP id 22-20020a630416000000b00386066e33d9mr8947228pge.146.1648694900195; Wed, 30 Mar 2022 19:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648694900; cv=none; d=google.com; s=arc-20160816; b=FIAwU/tbsOHgMUs9p5xzZwngL0yXSIdlYDoD01MDRWO/eW38RHzPMRlKRCTpG1Mk9H xtFZqhdAt3Roc3xc9wxr6CYAPjPaAfuIaZPmeft1SNHKiBLuUsVDOjEMTxgZHMtPrRGl ZbcbQpFanwZxXgihJrTYmfx/tFlAlcDXTf4Jmg1t8o9btZZBUgz2yRLKmwiCzYus+jAw 12Te0VTHlHzbiNiTbkN3eFGe5ToNzRyObP23oJqd22pAoi1rWEkUSz+sGAFL56RMJP+u gmPxddetqq/enfmg/1bCKoBNkHKYxzi5Hh/crUXySN59V7nbftuo26m5Va891Zxs4Mjy FkyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=RtAGlblxU33UEYgAgfC+H5UuPFuHTP34DbTO3E1emW4=; b=0RXcDL2zO4VBvFOCKwXhbaC8sYQYcfhP2fDIM1hffWSyXsHsqLOFK/qhPVmv+mLK2N feuqM+IR/CnEvf35n0SMz3yQCcZEUzRVkd4oQQe1gj/IGStJWUR1rwvpTmFU4NjLnq9D ZOmGP6ZktOKDBIXUY3aVJ9ownfScOY9HgNbcMTxrTHnQXTjYoI5O7ulqDaKinCMQmXsi ARBNltAbwp6ZDmSj22yIabEFHy1Y811uVgeZN60k0Zmux61DOV7m5r9fy+kPOYNroUtD xvxt7qsu24n7bFnrqIqXdi51w/CjgdCoSTxRmhvGzRb2oBmpcvvYyTpqLjDEwKKxl5WL sbcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=TPaGbvNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w66-20020a636245000000b003816043ee2asi17805354pgb.31.2022.03.30.19.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=TPaGbvNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 115CA99EDA; Wed, 30 Mar 2022 19:37:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240550AbiC2SdO (ORCPT + 99 others); Tue, 29 Mar 2022 14:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235403AbiC2SdM (ORCPT ); Tue, 29 Mar 2022 14:33:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A28C7179429; Tue, 29 Mar 2022 11:31:29 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 48F071FDA6; Tue, 29 Mar 2022 18:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1648578688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RtAGlblxU33UEYgAgfC+H5UuPFuHTP34DbTO3E1emW4=; b=TPaGbvNl3lqWnz/qjo9dy/g/grj+Kf/HcuojNIZBusOAfig4RElHxWtDNUQaopgjSO8IY3 TNoZ5rn7NB9aU54Fp0vRW4P8PbHKU+ZXp7zKOk/dnzD2YOIa2DE40iTg2SuR4pfHnYhxOE RfE2r+AWVCTJEhyMZiUq708rcJHanFY= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C86B713A7E; Tue, 29 Mar 2022 18:31:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /9fpLX9QQ2IDRQAAMHmgww (envelope-from ); Tue, 29 Mar 2022 18:31:27 +0000 Message-ID: <9c49bded-dbdc-8b8b-e6d4-f71fa7d33cbc@suse.com> Date: Tue, 29 Mar 2022 21:31:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 2/2] btrfs: Allocate page arrays using bulk page allocator. Content-Language: en-US To: Sweet Tea Dorminy , Chris Mason , Josef Bacik , David Sterba , Nick Terrell , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com References: <9cbd861d3b302e19b990848ea747d2ea91d01aed.1648497027.git.sweettea-kernel@dorminy.me> From: Nikolay Borisov In-Reply-To: <9cbd861d3b302e19b990848ea747d2ea91d01aed.1648497027.git.sweettea-kernel@dorminy.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 On 28.03.22 г. 23:14 ч., Sweet Tea Dorminy wrote: > While calling alloc_page() in a loop is an effective way to populate an > array of pages, the kernel provides a method to allocate pages in bulk. > alloc_pages_bulk_array() populates the NULL slots in a page array, trying to > grab more than one page at a time. > > Unfortunately, it doesn't guarantee allocating all slots in the array, > but it's easy to call it in a loop and return an error if no progress > occurs. Similar code can be found in xfs/xfs_buf.c:xfs_buf_alloc_pages(). > > Signed-off-by: Sweet Tea Dorminy Reviewed-by: Nikolay Borisov