Skip to content

Commit 70dec80

Browse files
committed
Btrfs: extent_io and extent_state optimizations
The end_bio routines are changed to take a pointer to the extent state struct, and the state tree is walked in order to set/clear appropriate bits as IO completes. This greatly reduces the number of rbtree searches done by the end_bio handlers, and reduces lock contention. The extent_io releasepage function is changed to avoid expensive searches for locked state. Signed-off-by: Chris Mason <[email protected]>
1 parent aadfeb6 commit 70dec80

File tree

4 files changed

+298
-114
lines changed

4 files changed

+298
-114
lines changed

fs/btrfs/disk-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ int btree_readpage(struct file *file, struct page *page)
274274
return extent_read_full_page(tree, page, btree_get_extent);
275275
}
276276

277-
static int btree_releasepage(struct page *page, gfp_t unused_gfp_flags)
277+
static int btree_releasepage(struct page *page, gfp_t gfp_flags)
278278
{
279279
struct extent_io_tree *tree;
280280
struct extent_map_tree *map;
281281
int ret;
282282

283283
tree = &BTRFS_I(page->mapping->host)->io_tree;
284284
map = &BTRFS_I(page->mapping->host)->extent_tree;
285-
ret = try_release_extent_mapping(map, tree, page);
285+
ret = try_release_extent_mapping(map, tree, page, gfp_flags);
286286
if (ret == 1) {
287287
ClearPagePrivate(page);
288288
set_page_private(page, 0);

0 commit comments

Comments
 (0)