Commit bb8b20ed authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o

ext4: do not use yield()

Using yield() is strongly discouraged (see sched/core.c) especially
since we can just use cond_resched().

Replace all use of yield() with cond_resched().
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent e3d85c36
...@@ -1352,7 +1352,7 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock) ...@@ -1352,7 +1352,7 @@ static int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock)
ei->i_da_metadata_calc_last_lblock = save_last_lblock; ei->i_da_metadata_calc_last_lblock = save_last_lblock;
spin_unlock(&ei->i_block_reservation_lock); spin_unlock(&ei->i_block_reservation_lock);
if (ext4_should_retry_alloc(inode->i_sb, &retries)) { if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
yield(); cond_resched();
goto repeat; goto repeat;
} }
dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1)); dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1));
......
...@@ -3692,11 +3692,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, ...@@ -3692,11 +3692,7 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
if (free < needed && busy) { if (free < needed && busy) {
busy = 0; busy = 0;
ext4_unlock_group(sb, group); ext4_unlock_group(sb, group);
/* cond_resched();
* Yield the CPU here so that we don't get soft lockup
* in non preempt case.
*/
yield();
goto repeat; goto repeat;
} }
...@@ -4246,7 +4242,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, ...@@ -4246,7 +4242,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
ext4_claim_free_clusters(sbi, ar->len, ar->flags)) { ext4_claim_free_clusters(sbi, ar->len, ar->flags)) {
/* let others to free the space */ /* let others to free the space */
yield(); cond_resched();
ar->len = ar->len >> 1; ar->len = ar->len >> 1;
} }
if (!ar->len) { if (!ar->len) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment