diff options
author | Josef Bacik <jbacik@fb.com> | 2015-09-29 11:40:47 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-21 18:55:19 -0700 |
commit | 4f4db2174d8d6cdc093cbb79d17fbfe0f4d9fbde (patch) | |
tree | ae850a309ddfe971d0e862aafbfb951163b5a842 /fs/btrfs/ctree.h | |
parent | 36af4e0737f6aa494e43497a5a34588a1d5cb12f (diff) | |
download | lwn-4f4db2174d8d6cdc093cbb79d17fbfe0f4d9fbde.tar.gz lwn-4f4db2174d8d6cdc093cbb79d17fbfe0f4d9fbde.zip |
Btrfs: keep track of max_extent_size per space_info
When we are heavily fragmented we can induce a lot of latency trying to make an
allocation happen that is simply not going to happen. Thankfully we keep track
of our max_extent_size when going through the allocator, so if we get to the
point where we are exiting find_free_extent with ENOSPC then set our
space_info->max_extent_size so we can keep future allocations from having to pay
this cost. We reset the max_extent_size whenever we release pinned bytes back
into this space info so we can redo all the work. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 16384231db82..78a8f56c7e88 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -1154,6 +1154,10 @@ struct btrfs_space_info { delalloc/allocations */ u64 bytes_readonly; /* total bytes that are read only */ + u64 max_extent_size; /* This will hold the maximum extent size of + the space info if we had an ENOSPC in the + allocator. */ + unsigned int full:1; /* indicates that we cannot allocate any more chunks for this space */ unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ |