aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-10-14 14:02:10 -0400
committerJosef Bacik <josef@redhat.com>2011-10-19 15:12:58 -0400
commit877da174301dde9062b915da4c8103048be49702 (patch)
treed7110b64088d6e14e86cfeb02c483dd48c303c56 /fs/btrfs/extent-tree.c
parentf104d044376aadcee74605d66b8d9dc2e145782c (diff)
Btrfs: allow shrink_delalloc flush the needed reclaimed pages
Currently we only allow a maximum of 2 megabytes of pages to be flushed at a time. This was ok before, but now we have overcommit which will screw us in a heartbeat if we are quickly filling the disk. So instead pick either 2 megabytes or the number of pages we need to reclaim to be safe again, which ever is larger. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 96cbc5104959..424ae82855c8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3343,7 +3343,7 @@ static int shrink_delalloc(struct btrfs_trans_handle *trans,
3343 u64 max_reclaim; 3343 u64 max_reclaim;
3344 u64 reclaimed = 0; 3344 u64 reclaimed = 0;
3345 long time_left; 3345 long time_left;
3346 int nr_pages = (2 * 1024 * 1024) >> PAGE_CACHE_SHIFT; 3346 unsigned long nr_pages = (2 * 1024 * 1024) >> PAGE_CACHE_SHIFT;
3347 int loops = 0; 3347 int loops = 0;
3348 unsigned long progress; 3348 unsigned long progress;
3349 3349
@@ -3366,7 +3366,8 @@ static int shrink_delalloc(struct btrfs_trans_handle *trans,
3366 } 3366 }
3367 3367
3368 max_reclaim = min(reserved, to_reclaim); 3368 max_reclaim = min(reserved, to_reclaim);
3369 3369 nr_pages = max_t(unsigned long, nr_pages,
3370 max_reclaim >> PAGE_CACHE_SHIFT);
3370 while (loops < 1024) { 3371 while (loops < 1024) {
3371 /* have the flusher threads jump in and do some IO */ 3372 /* have the flusher threads jump in and do some IO */
3372 smp_mb(); 3373 smp_mb();