Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46891532 authored by Jan Kara's avatar Jan Kara
Browse files

ext2: 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

).

Port of the same ext3 patch.

Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 8cef107a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1331,6 +1331,12 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
			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