2017-12-17 22:00:59 -05:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2007-05-09 07:51:49 +02:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2009-12-23 06:52:08 -05:00
|
|
|
|
2009-06-17 11:47:48 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:24 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2020-11-07 00:00:49 -05:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
2010-08-03 21:35:12 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2019-11-05 17:44:25 +01:00
|
|
|
|
2013-06-04 12:12:57 -04:00
|
|
|
|
2010-08-03 21:35:12 -04:00
|
|
|
|
2019-01-31 23:42:11 -05:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2010-08-03 21:35:12 -04:00
|
|
|
|
2014-09-16 14:50:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2013-06-04 12:12:57 -04:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
2024-07-24 17:11:16 +01:00
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2024-07-24 17:11:16 +01:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
2024-07-24 17:11:16 +01:00
|
|
|
|
|
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2010-08-03 21:35:12 -04:00
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
|
|
|
|
|
jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error
In __jbd2_log_wait_for_space(), we might call jbd2_cleanup_journal_tail()
to recover some journal space. But if an error occurs while executing
jbd2_cleanup_journal_tail() (e.g., an EIO), we don't stop waiting for free
space right away, we try other branches, and if j_committing_transaction
is NULL (i.e., the tid is 0), we will get the following complain:
============================================
JBD2: I/O error when updating journal superblock for sdd-8.
__jbd2_log_wait_for_space: needed 256 blocks and only had 217 space available
__jbd2_log_wait_for_space: no way to get more journal space in sdd-8
------------[ cut here ]------------
WARNING: CPU: 2 PID: 139804 at fs/jbd2/checkpoint.c:109 __jbd2_log_wait_for_space+0x251/0x2e0
Modules linked in:
CPU: 2 PID: 139804 Comm: kworker/u8:3 Not tainted 6.6.0+ #1
RIP: 0010:__jbd2_log_wait_for_space+0x251/0x2e0
Call Trace:
<TASK>
add_transaction_credits+0x5d1/0x5e0
start_this_handle+0x1ef/0x6a0
jbd2__journal_start+0x18b/0x340
ext4_dirty_inode+0x5d/0xb0
__mark_inode_dirty+0xe4/0x5d0
generic_update_time+0x60/0x70
[...]
============================================
So only if jbd2_cleanup_journal_tail() returns 1, i.e., there is nothing to
clean up at the moment, continue to try to reclaim free space in other ways.
Note that this fix relies on commit 6f6a6fda2945 ("jbd2: fix ocfs2 corrupt
when updating journal superblock fails") to make jbd2_cleanup_journal_tail
return the correct error code.
Fixes: 8c3f25d8950c ("jbd2: don't give up looking for space so easily in __jbd2_log_wait_for_space")
Cc: stable@kernel.org
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240718115336.2554501-1-libaokun@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2024-07-18 19:53:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
2024-07-24 17:11:16 +01:00
|
|
|
|
jbd2: drop checkpoint mutex when waiting in __jbd2_log_wait_for_space()
While trying to debug an an issue under extreme I/O loading
on preempt-rt kernels, the following backtrace was observed
via SysRQ output:
rm D ffff8802203afbc0 4600 4878 4748 0x00000000
ffff8802217bfb78 0000000000000082 ffff88021fc2bb80 ffff88021fc2bb80
ffff88021fc2bb80 ffff8802217bffd8 ffff8802217bffd8 ffff8802217bffd8
ffff88021f1d4c80 ffff88021fc2bb80 ffff8802217bfb88 ffff88022437b000
Call Trace:
[<ffffffff8172dc34>] schedule+0x24/0x70
[<ffffffff81225b5d>] jbd2_log_wait_commit+0xbd/0x140
[<ffffffff81060390>] ? __init_waitqueue_head+0x50/0x50
[<ffffffff81223635>] jbd2_log_do_checkpoint+0xf5/0x520
[<ffffffff81223b09>] __jbd2_log_wait_for_space+0xa9/0x1f0
[<ffffffff8121dc40>] start_this_handle.isra.10+0x2e0/0x530
[<ffffffff81060390>] ? __init_waitqueue_head+0x50/0x50
[<ffffffff8121e0a3>] jbd2__journal_start+0xc3/0x110
[<ffffffff811de7ce>] ? ext4_rmdir+0x6e/0x230
[<ffffffff8121e0fe>] jbd2_journal_start+0xe/0x10
[<ffffffff811f308b>] ext4_journal_start_sb+0x5b/0x160
[<ffffffff811de7ce>] ext4_rmdir+0x6e/0x230
[<ffffffff811435c5>] vfs_rmdir+0xd5/0x140
[<ffffffff8114370f>] do_rmdir+0xdf/0x120
[<ffffffff8105c6b4>] ? task_work_run+0x44/0x80
[<ffffffff81002889>] ? do_notify_resume+0x89/0x100
[<ffffffff817361ae>] ? int_signal+0x12/0x17
[<ffffffff81145d85>] sys_unlinkat+0x25/0x40
[<ffffffff81735f22>] system_call_fastpath+0x16/0x1b
What is interesting here, is that we call log_wait_commit, from
within wait_for_space, but we are still holding the checkpoint_mutex
as it surrounds mostly the whole of wait_for_space. And then, as we
are waiting, journal_commit_transaction can run, and if the JBD2_FLUSHED
bit is set, then we will also try to take the same checkpoint_mutex.
It seems that we need to drop the checkpoint_mutex while sitting in
jbd2_log_wait_commit, if we want to guarantee that progress can be made
by jbd2_journal_commit_transaction(). There does not seem to be
anything preempt-rt specific about this, other then perhaps increasing
the odds of it happening.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-06-12 22:47:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
jbd2: drop checkpoint mutex when waiting in __jbd2_log_wait_for_space()
While trying to debug an an issue under extreme I/O loading
on preempt-rt kernels, the following backtrace was observed
via SysRQ output:
rm D ffff8802203afbc0 4600 4878 4748 0x00000000
ffff8802217bfb78 0000000000000082 ffff88021fc2bb80 ffff88021fc2bb80
ffff88021fc2bb80 ffff8802217bffd8 ffff8802217bffd8 ffff8802217bffd8
ffff88021f1d4c80 ffff88021fc2bb80 ffff8802217bfb88 ffff88022437b000
Call Trace:
[<ffffffff8172dc34>] schedule+0x24/0x70
[<ffffffff81225b5d>] jbd2_log_wait_commit+0xbd/0x140
[<ffffffff81060390>] ? __init_waitqueue_head+0x50/0x50
[<ffffffff81223635>] jbd2_log_do_checkpoint+0xf5/0x520
[<ffffffff81223b09>] __jbd2_log_wait_for_space+0xa9/0x1f0
[<ffffffff8121dc40>] start_this_handle.isra.10+0x2e0/0x530
[<ffffffff81060390>] ? __init_waitqueue_head+0x50/0x50
[<ffffffff8121e0a3>] jbd2__journal_start+0xc3/0x110
[<ffffffff811de7ce>] ? ext4_rmdir+0x6e/0x230
[<ffffffff8121e0fe>] jbd2_journal_start+0xe/0x10
[<ffffffff811f308b>] ext4_journal_start_sb+0x5b/0x160
[<ffffffff811de7ce>] ext4_rmdir+0x6e/0x230
[<ffffffff811435c5>] vfs_rmdir+0xd5/0x140
[<ffffffff8114370f>] do_rmdir+0xdf/0x120
[<ffffffff8105c6b4>] ? task_work_run+0x44/0x80
[<ffffffff81002889>] ? do_notify_resume+0x89/0x100
[<ffffffff817361ae>] ? int_signal+0x12/0x17
[<ffffffff81145d85>] sys_unlinkat+0x25/0x40
[<ffffffff81735f22>] system_call_fastpath+0x16/0x1b
What is interesting here, is that we call log_wait_commit, from
within wait_for_space, but we are still holding the checkpoint_mutex
as it surrounds mostly the whole of wait_for_space. And then, as we
are waiting, journal_commit_transaction can run, and if the JBD2_FLUSHED
bit is set, then we will also try to take the same checkpoint_mutex.
It seems that we need to drop the checkpoint_mutex while sitting in
jbd2_log_wait_commit, if we want to guarantee that progress can be made
by jbd2_journal_commit_transaction(). There does not seem to be
anything preempt-rt specific about this, other then perhaps increasing
the odds of it happening.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-06-12 22:47:35 -04:00
|
|
|
|
|
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2008-11-06 22:38:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-04 20:46:12 +08:00
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
2010-08-03 21:35:12 -04:00
|
|
|
|
2008-10-08 23:28:31 -04:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-05 00:09:22 -05:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2011-06-27 12:36:29 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2011-06-27 12:36:29 -04:00
|
|
|
|
2010-08-11 17:06:24 +02:00
|
|
|
|
2025-08-25 20:53:39 +08:00
|
|
|
|
2011-06-27 12:36:29 -04:00
|
|
|
|
2010-08-11 17:06:24 +02:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2008-11-05 00:09:22 -05:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-10 20:29:13 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-04 18:09:22 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2022-06-08 13:23:48 +02:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2009-06-17 11:47:48 -04:00
|
|
|
|
2022-06-08 13:23:48 +02:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-28 23:58:27 -05:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-31 23:42:11 -05:00
|
|
|
|
|
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
2019-01-31 23:42:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
2019-01-31 23:42:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2023-06-06 21:59:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-04 18:09:29 -04:00
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
2023-06-06 21:59:26 +08:00
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
2023-06-06 21:59:23 +08:00
|
|
|
|
|
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-12 14:37:52 +08:00
|
|
|
|
2014-09-01 21:19:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:36 +08:00
|
|
|
|
2008-10-10 20:29:13 -04:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-10 20:29:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2012-03-13 22:22:54 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2008-10-10 20:29:13 -04:00
|
|
|
|
2015-06-15 14:36:01 -04:00
|
|
|
|
2008-10-10 20:29:13 -04:00
|
|
|
|
2012-03-13 22:22:54 -04:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2009-12-23 06:52:08 -05:00
|
|
|
|
2012-03-13 22:22:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-23 06:52:08 -05:00
|
|
|
|
2012-03-13 22:22:54 -04:00
|
|
|
|
2021-01-26 15:52:35 +01:00
|
|
|
|
2012-03-13 22:22:54 -04:00
|
|
|
|
2015-06-15 14:36:01 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
jbd2: fix checkpoint cleanup performance regression
journal_clean_one_cp_list() has been merged into
journal_shrink_one_cp_list(), but do chekpoint buffer cleanup from the
committing process is just a best effort, it should stop scan once it
meet a busy buffer, or else it will cause a lot of invalid buffer scan
and checks. We catch a performance regression when doing fs_mark tests
below.
Test cmd:
./fs_mark -d scratch -s 1024 -n 10000 -t 1 -D 100 -N 100
Before merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8304.9 49033
After merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 7649.0 50012
FSUse% Count Size Files/sec App Overhead
95 10000 1024 2107.1 50871
After merging checkpoint buffer cleanup, the total loop count in
journal_shrink_one_cp_list() could be up to 6,261,600+ (50,000+ ~
100,000+ in general), most of them are invalid. This patch fix it
through passing 'shrink_type' into journal_shrink_one_cp_list() and add
a new 'SHRINK_BUSY_STOP' to indicate it should stop once meet a busy
buffer. After fix, the loop count descending back to 10,000+.
After this fix:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8558.4 49109
Cc: stable@kernel.org
Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230714025528.564988-2-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2023-07-14 10:55:26 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:38 +08:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
2023-06-06 21:59:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jbd2: fix checkpoint cleanup performance regression
journal_clean_one_cp_list() has been merged into
journal_shrink_one_cp_list(), but do chekpoint buffer cleanup from the
committing process is just a best effort, it should stop scan once it
meet a busy buffer, or else it will cause a lot of invalid buffer scan
and checks. We catch a performance regression when doing fs_mark tests
below.
Test cmd:
./fs_mark -d scratch -s 1024 -n 10000 -t 1 -D 100 -N 100
Before merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8304.9 49033
After merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 7649.0 50012
FSUse% Count Size Files/sec App Overhead
95 10000 1024 2107.1 50871
After merging checkpoint buffer cleanup, the total loop count in
journal_shrink_one_cp_list() could be up to 6,261,600+ (50,000+ ~
100,000+ in general), most of them are invalid. This patch fix it
through passing 'shrink_type' into journal_shrink_one_cp_list() and add
a new 'SHRINK_BUSY_STOP' to indicate it should stop once meet a busy
buffer. After fix, the loop count descending back to 10,000+.
After this fix:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8558.4 49109
Cc: stable@kernel.org
Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230714025528.564988-2-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2023-07-14 10:55:26 +08:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
jbd2: fix checkpoint cleanup performance regression
journal_clean_one_cp_list() has been merged into
journal_shrink_one_cp_list(), but do chekpoint buffer cleanup from the
committing process is just a best effort, it should stop scan once it
meet a busy buffer, or else it will cause a lot of invalid buffer scan
and checks. We catch a performance regression when doing fs_mark tests
below.
Test cmd:
./fs_mark -d scratch -s 1024 -n 10000 -t 1 -D 100 -N 100
Before merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8304.9 49033
After merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 7649.0 50012
FSUse% Count Size Files/sec App Overhead
95 10000 1024 2107.1 50871
After merging checkpoint buffer cleanup, the total loop count in
journal_shrink_one_cp_list() could be up to 6,261,600+ (50,000+ ~
100,000+ in general), most of them are invalid. This patch fix it
through passing 'shrink_type' into journal_shrink_one_cp_list() and add
a new 'SHRINK_BUSY_STOP' to indicate it should stop once meet a busy
buffer. After fix, the loop count descending back to 10,000+.
After this fix:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8558.4 49109
Cc: stable@kernel.org
Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230714025528.564988-2-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2023-07-14 10:55:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:27 +08:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2024-07-24 17:11:17 +01:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-24 17:11:17 +01:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
2024-07-24 17:11:17 +01:00
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-24 17:11:17 +01:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-07 14:53:54 +08:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
2024-04-07 14:53:54 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2014-09-18 00:58:12 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
jbd2: fix checkpoint cleanup performance regression
journal_clean_one_cp_list() has been merged into
journal_shrink_one_cp_list(), but do chekpoint buffer cleanup from the
committing process is just a best effort, it should stop scan once it
meet a busy buffer, or else it will cause a lot of invalid buffer scan
and checks. We catch a performance regression when doing fs_mark tests
below.
Test cmd:
./fs_mark -d scratch -s 1024 -n 10000 -t 1 -D 100 -N 100
Before merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8304.9 49033
After merging checkpoint buffer cleanup:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 7649.0 50012
FSUse% Count Size Files/sec App Overhead
95 10000 1024 2107.1 50871
After merging checkpoint buffer cleanup, the total loop count in
journal_shrink_one_cp_list() could be up to 6,261,600+ (50,000+ ~
100,000+ in general), most of them are invalid. This patch fix it
through passing 'shrink_type' into journal_shrink_one_cp_list() and add
a new 'SHRINK_BUSY_STOP' to indicate it should stop once meet a busy
buffer. After fix, the loop count descending back to 10,000+.
After this fix:
FSUse% Count Size Files/sec App Overhead
95 10000 1024 8558.4 49109
Cc: stable@kernel.org
Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230714025528.564988-2-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2023-07-14 10:55:26 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-18 00:58:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:25 +08:00
|
|
|
|
2014-09-18 00:58:12 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-28 14:57:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-07 14:53:55 +08:00
|
|
|
|
2015-07-28 14:57:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-13 15:38:22 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2009-09-30 00:32:06 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-13 15:38:22 -04:00
|
|
|
|
2021-06-10 19:24:34 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2021-07-02 18:05:03 -04:00
|
|
|
|
2011-06-13 15:38:22 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
2023-06-06 21:59:24 +08:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-28 23:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2008-01-28 23:58:27 -05:00
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2011-06-13 15:38:22 -04:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-30 00:32:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2012-02-20 17:53:02 -05:00
|
|
|
|
2021-06-10 19:24:33 +08:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-14 10:55:27 +08:00
|
|
|
|
|
|
|
|
|
2023-06-06 21:59:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-13 15:38:22 -04:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-02 18:05:03 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:59 -07:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
2021-06-10 19:24:37 +08:00
|
|
|
|
|
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-02 08:43:25 -04:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-20 17:53:01 -05:00
|
|
|
|
|
|
|
|
|
2022-06-08 13:23:48 +02:00
|
|
|
|
2006-10-11 01:20:57 -07:00
|
|
|
|