fs/fs-writeback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
The dirtytime_work is a background housekeeping task that flushes dirty
inodes, using round_jiffies_relative() will allow kernel to batch this
work with other aligned system tasks, reducing power consumption.
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
---
fs/fs-writeback.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index ea95f527aace..a32d354152d0 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -2504,7 +2504,8 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
}
rcu_read_unlock();
if (dirtytime_expire_interval)
- schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
+ schedule_delayed_work(&dirtytime_work,
+ round_jiffies_relative(dirtytime_expire_interval * HZ));
}
static int dirtytime_interval_handler(const struct ctl_table *table, int write,
@@ -2536,7 +2537,8 @@ static const struct ctl_table vm_fs_writeback_table[] = {
static int __init start_dirtytime_writeback(void)
{
if (dirtytime_expire_interval)
- schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
+ schedule_delayed_work(&dirtytime_work,
+ round_jiffies_relative(dirtytime_expire_interval * HZ));
register_sysctl_init("vm", vm_fs_writeback_table);
return 0;
}
--
2.43.0
On Tue, 13 Jan 2026 16:26:14 +0800, Zhao Mengmeng wrote:
> The dirtytime_work is a background housekeeping task that flushes dirty
> inodes, using round_jiffies_relative() will allow kernel to batch this
> work with other aligned system tasks, reducing power consumption.
>
>
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] writeback: use round_jiffies_relative for dirtytime_work
https://git.kernel.org/vfs/vfs/c/e93b31d08162
On Tue 13-01-26 16:26:14, Zhao Mengmeng wrote:
> From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
>
> The dirtytime_work is a background housekeeping task that flushes dirty
> inodes, using round_jiffies_relative() will allow kernel to batch this
> work with other aligned system tasks, reducing power consumption.
>
> Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
Makes sense. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/fs-writeback.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index ea95f527aace..a32d354152d0 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -2504,7 +2504,8 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
> }
> rcu_read_unlock();
> if (dirtytime_expire_interval)
> - schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> + schedule_delayed_work(&dirtytime_work,
> + round_jiffies_relative(dirtytime_expire_interval * HZ));
> }
>
> static int dirtytime_interval_handler(const struct ctl_table *table, int write,
> @@ -2536,7 +2537,8 @@ static const struct ctl_table vm_fs_writeback_table[] = {
> static int __init start_dirtytime_writeback(void)
> {
> if (dirtytime_expire_interval)
> - schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
> + schedule_delayed_work(&dirtytime_work,
> + round_jiffies_relative(dirtytime_expire_interval * HZ));
> register_sysctl_init("vm", vm_fs_writeback_table);
> return 0;
> }
> --
> 2.43.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
© 2016 - 2026 Red Hat, Inc.