diff options
author | Frans van de Wiel <fvdw@fvdw.eu> | 2010-03-15 19:29:34 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 19:30:36 +0200 |
commit | 8cef107a1d890ff76c85d665083ff3562be01d32 (patch) | |
tree | d8cb4a9acc01d110efeb43e2e9591f43596d5a16 /fs/ext3/balloc.c | |
parent | Fix networking tree iscsi_tcp.c mis-merge (diff) | |
download | linux-8cef107a1d890ff76c85d665083ff3562be01d32.tar.xz linux-8cef107a1d890ff76c85d665083ff3562be01d32.zip |
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 '')
-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: goto io_error; free_blocks = le16_to_cpu(gdp->bg_free_blocks_count); /* + * skip this group (and avoid loading bitmap) if there + * are no free blocks + */ + if (!free_blocks) + continue; + /* * skip this group if the number of * free blocks is less than half of the reservation * window size. |