Repository navigation
Commit 2ed5724
committed
ext4: add cond_resched() to ext4_free_blocks() & ext4_mb_regular_allocator()
For a file systems with a very large number of block groups, if all of
the block group bitmaps are in memory and the file system is
relatively badly fragmented, it's possible ext4_mb_regular_allocator()
to take a long time trying to find a good match. This is especially
true if the tuning parameter mb_max_to_scan has been sent to a very
large number. So add a cond_resched() to avoid soft lockup warnings
and to provide better system responsiveness.
For ext4_free_blocks(), if we are deleting a large range of blocks,
and data=journal is enabled so that EXT4_FREE_BLOCKS_FORGET is passed,
the loop to call sb_find_get_block() and to call ext4_forget() can
take over 10-15 milliseocnds or more. So it's better to add a
cond_resched() here a well.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>1 parent 20970ba commit 2ed5724
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2105 | 2105 | | |
2106 | 2106 | | |
2107 | 2107 | | |
| 2108 | + | |
2108 | 2109 | | |
2109 | 2110 | | |
2110 | 2111 | | |
| |||
4612 | 4613 | | |
4613 | 4614 | | |
4614 | 4615 | | |
| 4616 | + | |
4615 | 4617 | | |
4616 | 4618 | | |
4617 | 4619 | | |
4618 | | - | |
| 4620 | + | |
4619 | 4621 | | |
4620 | 4622 | | |
4621 | 4623 | | |
| |||
0 commit comments