aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/budget.c
diff options
context:
space:
mode:
authorLiu Song <liu.song11@zte.com.cn>2019-08-06 22:21:40 +0800
committerRichard Weinberger <richard@nod.at>2019-08-22 17:25:33 +0200
commit0af83abbd4a6e36a4b209d8c57c26143e40eeec1 (patch)
tree34e3a15202d2043e0990602a1f3c79c980468696 /fs/ubifs/budget.c
parentubifs: Correctly initialize c->min_log_bytes (diff)
downloadlinux-dev-0af83abbd4a6e36a4b209d8c57c26143e40eeec1.tar.xz
linux-dev-0af83abbd4a6e36a4b209d8c57c26143e40eeec1.zip
ubifs: Limit the number of pages in shrink_liability
If the number of dirty pages to be written back is large, then writeback_inodes_sb will block waiting for a long time, causing hung task detection alarm. Therefore, we should limit the maximum number of pages written back this time, which let the budget be completed faster. The remaining dirty pages tend to rely on the writeback mechanism to complete the synchronization. Fixes: b6e51316daed ("writeback: separate starting of sync vs opportunistic writeback") Signed-off-by: Liu Song <liu.song11@zte.com.cn> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to '')
-rw-r--r--fs/ubifs/budget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index 80d7301ab76d..c0b84e960b20 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -51,7 +51,7 @@
static void shrink_liability(struct ubifs_info *c, int nr_to_write)
{
down_read(&c->vfs_sb->s_umount);
- writeback_inodes_sb(c->vfs_sb, WB_REASON_FS_FREE_SPACE);
+ writeback_inodes_sb_nr(c->vfs_sb, nr_to_write, WB_REASON_FS_FREE_SPACE);
up_read(&c->vfs_sb->s_umount);
}