[RHEL7,COMMIT] fs-writeback: add cond_resched() in wb_do_writeback()

Submitted by Konstantin Khorenko on Oct. 25, 2019, 10:03 p.m.

Details

Message ID 201910252203.x9PM3HC9006825@finist-ce7.sw.ru
State New
Series "fs-writeback: add cond_resched() in wb_do_writeback()"
Headers show

Commit Message

Konstantin Khorenko Oct. 25, 2019, 10:03 p.m.
The commit is pushed to "branch-rh7-3.10.0-1062.1.2.vz7.114.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.1.2.vz7.114.10
------>
commit f7bdb500460a0c196c6f5db27bea75b8ae1dbeda
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Sat Oct 26 01:03:17 2019 +0300

    fs-writeback: add cond_resched() in wb_do_writeback()
    
    In case of too many writeback works we might not reschedule for
    too long. Add cond_resched() just in case.
    
    https://jira.sw.ru/browse/PSBM-97743
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 fs/fs-writeback.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index bf57e612114e..dd6b06ded3f4 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1133,6 +1133,7 @@  static long wb_do_writeback(struct bdi_writeback *wb)
 		trace_writeback_exec(bdi, work);
 
 		wrote += wb_writeback(wb, work);
+		cond_resched();
 
 		/*
 		 * Notify the caller of completion if this is a synchronous