]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: allocate page arrays using bulk page allocator
authorSweet Tea Dorminy <sweettea-kernel@dorminy.me>
Wed, 30 Mar 2022 20:11:23 +0000 (16:11 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:11 +0000 (17:03 +0200)
commitbd1d4c53e885b5ac8518c0a4793093add0c2ac29
treedec40c8a71ce428f4ff34057043f31924df4082a
parentaf017081126c25903ec282f8f0f9a52ffb43d95e
btrfs: allocate page arrays using bulk page allocator

While calling alloc_page() in a loop is an effective way to populate an
array of pages, the MM subsystem 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.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c