forked from luck/tmp_suning_uos_patched
ext4: stop looping in ext4_num_dirty_pages when max_pages reached
Today we simply break out of the inner loop when we have accumulated max_pages; this keeps scanning forwad and doing pagevec_lookup_tag() in the while (!done) loop, this does potentially a lot of work with no net effect. When we have accumulated max_pages, just clean up and return. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
fb1813f4a8
commit
659c6009ca
@ -1207,9 +1207,11 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
|
|||||||
break;
|
break;
|
||||||
idx++;
|
idx++;
|
||||||
num++;
|
num++;
|
||||||
if (num >= max_pages)
|
if (num >= max_pages) {
|
||||||
|
done = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pagevec_release(&pvec);
|
pagevec_release(&pvec);
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
|
Loading…
Reference in New Issue
Block a user