diff options
author | Frans van de Wiel <fvdw@fvdw.eu> | 2010-03-15 14:29:34 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:36 -0400 |
commit | 8cef107a1d890ff76c85d665083ff3562be01d32 (patch) | |
tree | d8cb4a9acc01d110efeb43e2e9591f43596d5a16 /fs/ext3 | |
parent | 70ca0a42fe1702ac0784386c44b05d18ee5f1f9e (diff) |
ext3: Avoid loading bitmaps for full groups during block allocation
There is no point in loading bitmap for groups which are completely full.
This causes noticeable performance problems (and memory pressure) on small
systems with large full filesystem
(http://marc.info/?l=linux-ext4&m=126843108314310&w=2).
Jan Kara: Added a comment and changed check to use cpu-endian value.
Signed-off-by: "Frans van de Wiel" <fvdw@fvdw.eu>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/balloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index a177122a1b25..4a32511f4ded 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -1584,6 +1584,12 @@ retry_alloc: | |||
1584 | goto io_error; | 1584 | goto io_error; |
1585 | free_blocks = le16_to_cpu(gdp->bg_free_blocks_count); | 1585 | free_blocks = le16_to_cpu(gdp->bg_free_blocks_count); |
1586 | /* | 1586 | /* |
1587 | * skip this group (and avoid loading bitmap) if there | ||
1588 | * are no free blocks | ||
1589 | */ | ||
1590 | if (!free_blocks) | ||
1591 | continue; | ||
1592 | /* | ||
1587 | * skip this group if the number of | 1593 | * skip this group if the number of |
1588 | * free blocks is less than half of the reservation | 1594 | * free blocks is less than half of the reservation |
1589 | * window size. | 1595 | * window size. |