Skip to content

Commit

Permalink
ext3: Avoid loading bitmaps for full groups during block allocation
Browse files Browse the repository at this point in the history
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" <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
Frans van de Wiel authored and jankara committed May 21, 2010
1 parent 70ca0a4 commit 8cef107
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/ext3/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,12 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
if (!gdp)
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
Expand Down

0 comments on commit 8cef107

Please sign in to comment.