[Devel] [PATCH RHEL7 COMMIT] ms/fs: add dirtytime_expire_seconds sysctl

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 26 04:10:30 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.18
------>
commit 4358766e854cd2aa8eb8f003655dfb2abfcd0312
Author: Dmitry Monakhov <dmonakhov at openvz.org>
Date:   Fri Jun 26 15:10:30 2015 +0400

    ms/fs: add dirtytime_expire_seconds sysctl
    
    ML-commit: 1efff914afac8a965ad63817ecf8861a927c2ace Mon Sep 17 00:00:00 2001
    
    Add a tuning knob so we can adjust the dirtytime expiration timeout,
    which is very useful for testing lazytime.
    
    Signed-off-by: Theodore Ts'o <tytso at mit.edu>
    Reviewed-by: Jan Kara <jack at suse.cz>
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 fs/fs-writeback.c         | 11 +++++++++++
 include/linux/writeback.h |  3 +++
 kernel/sysctl.c           |  8 ++++++++
 3 files changed, 22 insertions(+)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index c89d8a4..252c831 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1199,6 +1199,17 @@ static int __init start_dirtytime_writeback(void)
 }
 __initcall(start_dirtytime_writeback);
 
+int dirtytime_interval_handler(struct ctl_table *table, int write,
+			       void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+	int ret;
+
+	ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
+	if (ret == 0 && write)
+		mod_delayed_work(system_wq, &dirtytime_work, 0);
+	return ret;
+}
+
 static noinline void block_dump___mark_inode_dirty(struct inode *inode)
 {
 	if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) {
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index d00fdc0..32e0bf8 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -135,6 +135,7 @@ extern int vm_dirty_ratio;
 extern unsigned long vm_dirty_bytes;
 extern unsigned int dirty_writeback_interval;
 extern unsigned int dirty_expire_interval;
+extern unsigned int dirtytime_expire_interval;
 extern int vm_highmem_is_dirtyable;
 extern int block_dump;
 extern int laptop_mode;
@@ -151,6 +152,8 @@ extern int dirty_ratio_handler(struct ctl_table *table, int write,
 extern int dirty_bytes_handler(struct ctl_table *table, int write,
 		void __user *buffer, size_t *lenp,
 		loff_t *ppos);
+int dirtytime_interval_handler(struct ctl_table *table, int write,
+			       void __user *buffer, size_t *lenp, loff_t *ppos);
 
 struct ctl_table;
 int dirty_writeback_centisecs_handler(struct ctl_table *, int,
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index fe20216..2380136 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1246,6 +1246,14 @@ static struct ctl_table vm_table[] = {
 		.extra1		= &zero,
 	},
 	{
+		.procname	= "dirtytime_expire_seconds",
+		.data		= &dirtytime_expire_interval,
+		.maxlen		= sizeof(dirty_expire_interval),
+		.mode		= 0644,
+		.proc_handler	= dirtytime_interval_handler,
+		.extra1		= &zero,
+	},
+	{
 		.procname       = "nr_pdflush_threads",
 		.mode           = 0444 /* read-only */,
 		.proc_handler   = pdflush_proc_obsolete,



More information about the Devel mailing list