Commit 6f2085c0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] reiserfs: scheduling latency improvements

From: Chris Mason <mason@suse.com>

Some latency improvements for the reiserfs data=ordered code from Takashi.
parent e2de7edb
...@@ -788,8 +788,7 @@ static int write_ordered_buffers(spinlock_t *lock, ...@@ -788,8 +788,7 @@ static int write_ordered_buffers(spinlock_t *lock,
if (chunk.nr) if (chunk.nr)
write_ordered_chunk(&chunk); write_ordered_chunk(&chunk);
wait_on_buffer(bh); wait_on_buffer(bh);
if (need_resched) cond_resched();
schedule();
spin_lock(lock); spin_lock(lock);
goto loop_next; goto loop_next;
} }
...@@ -803,11 +802,7 @@ static int write_ordered_buffers(spinlock_t *lock, ...@@ -803,11 +802,7 @@ static int write_ordered_buffers(spinlock_t *lock,
} }
loop_next: loop_next:
put_bh(bh); put_bh(bh);
if (chunk.nr == 0 && need_resched) { cond_resched_lock(lock);
spin_unlock(lock);
schedule();
spin_lock(lock);
}
} }
if (chunk.nr) { if (chunk.nr) {
spin_unlock(lock); spin_unlock(lock);
...@@ -828,11 +823,7 @@ static int write_ordered_buffers(spinlock_t *lock, ...@@ -828,11 +823,7 @@ static int write_ordered_buffers(spinlock_t *lock,
if (!buffer_uptodate(bh)) if (!buffer_uptodate(bh))
ret = -EIO; ret = -EIO;
put_bh(bh); put_bh(bh);
if (need_resched()) { cond_resched_lock(lock);
spin_unlock(lock);
schedule();
spin_lock(lock);
}
} }
spin_unlock(lock); spin_unlock(lock);
return ret; return ret;
...@@ -3469,6 +3460,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b ...@@ -3469,6 +3460,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
next = cn->next ; next = cn->next ;
free_cnode(p_s_sb, cn) ; free_cnode(p_s_sb, cn) ;
cn = next ; cn = next ;
cond_resched();
} }
/* we are done with both the c_bh and d_bh, but /* we are done with both the c_bh and d_bh, but
......
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