[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9c49bded-dbdc-8b8b-e6d4-f71fa7d33cbc@suse.com>
Date: Tue, 29 Mar 2022 21:31:27 +0300
From: Nikolay Borisov <nborisov@...e.com>
To: Sweet Tea Dorminy <sweettea-kernel@...miny.me>,
Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
Nick Terrell <terrelln@...com>, linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH 2/2] btrfs: Allocate page arrays using bulk page
allocator.
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 <sweettea-kernel@...miny.me>
Reviewed-by: Nikolay Borisov <nborisov@...e.com>
Powered by blists - more mailing lists