mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
writeback: Fix occasional slow sync(1)
In case when system contains no dirty pages, wakeup_flusher_threads() will submit WB_SYNC_NONE writeback for 0 pages so wb_writeback() exits immediately without doing anything. Thus sync(1) will write all the dirty inodes from a WB_SYNC_ALL writeback pass which is slow. Fix the problem by using get_nr_dirty_pages() in wakeup_flusher_threads() instead of calculating number of dirty pages manually. That function also takes number of dirty inodes into account. Change-Id: I458027ae08d9a5a93202a7b97ace1f8da7a18a07 CC: stable@vger.kernel.org Reported-by: Paul Taysom <taysom@chromium.org> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
73af84d854
commit
3b1a823ca1
1 changed files with 2 additions and 4 deletions
|
@ -999,10 +999,8 @@ void wakeup_flusher_threads(long nr_pages, enum wb_reason reason)
|
|||
{
|
||||
struct backing_dev_info *bdi;
|
||||
|
||||
if (!nr_pages) {
|
||||
nr_pages = global_page_state(NR_FILE_DIRTY) +
|
||||
global_page_state(NR_UNSTABLE_NFS);
|
||||
}
|
||||
if (!nr_pages)
|
||||
nr_pages = get_nr_dirty_pages();
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) {
|
||||
|
|
Loading…
Reference in a new issue