mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
writeback: avoid extra sync work at enqueue time
This removes writeback_control.wb_start and does more straightforward sync livelock prevention by setting .older_than_this to prevent extra inodes from being enqueued in the first place. Acked-by: Jan Kara <[email protected]> Signed-off-by: Wu Fengguang <[email protected]>
This commit is contained in:
parent
e8dfc30582
commit
e185dda89d
2 changed files with 3 additions and 16 deletions
|
|
@ -544,15 +544,6 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb,
|
|||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Was this inode dirtied after sync_sb_inodes was called?
|
||||
* This keeps sync from extra jobs and livelock.
|
||||
*/
|
||||
if (inode_dirtied_after(inode, wbc->wb_start)) {
|
||||
spin_unlock(&inode->i_lock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
__iget(inode);
|
||||
|
||||
pages_skipped = wbc->pages_skipped;
|
||||
|
|
@ -585,9 +576,6 @@ static void __writeback_inodes_wb(struct bdi_writeback *wb,
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!wbc->wb_start)
|
||||
wbc->wb_start = jiffies; /* livelock avoidance */
|
||||
|
||||
while (!list_empty(&wb->b_io)) {
|
||||
struct inode *inode = wb_inode(wb->b_io.prev);
|
||||
struct super_block *sb = inode->i_sb;
|
||||
|
|
@ -686,7 +674,9 @@ static long wb_writeback(struct bdi_writeback *wb,
|
|||
if (wbc.sync_mode == WB_SYNC_ALL || wbc.tagged_writepages)
|
||||
write_chunk = LONG_MAX;
|
||||
|
||||
wbc.wb_start = jiffies; /* livelock avoidance */
|
||||
oldest_jif = jiffies;
|
||||
wbc.older_than_this = &oldest_jif;
|
||||
|
||||
spin_lock(&wb->list_lock);
|
||||
for (;;) {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue