Messages in this thread Patch in this message | | | Date | Sat, 28 Jan 2006 03:47:00 +0100 | From | Bart Samwel <> | Subject | [PATCH 2/3] Represent laptop_mode as jiffies internally |
| |
Make that the internal value for /proc/sys/vm/laptop_mode is stored as jiffies instead of seconds. Let the sysctl interface do the conversions, instead of doing on-the-fly conversions every time the value is used.
Add a description of the fact that laptop_mode doubles as a flag and a timeout to the comment above the laptop_mode variable.
Signed-off-by: Bart Samwel <bart@samwel.tk>
--- linux-2.6.16-rc1.orig/kernel/sysctl.c 2006-01-28 02:09:32.000000000 +0100 +++ linux-2.6.16-rc1/kernel/sysctl.c 2006-01-28 02:13:10.000000000 +0100 @@ -823,9 +823,8 @@ .data = &laptop_mode, .maxlen = sizeof(laptop_mode), .mode = 0644, - .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, - .extra1 = &zero, + .proc_handler = &proc_dointvec_jiffies, + .strategy = &sysctl_jiffies, }, { .ctl_name = VM_BLOCK_DUMP, --- linux-2.6.16-rc1.orig/mm/page-writeback.c 2006-01-28 01:47:24.000000000 +0100 +++ linux-2.6.16-rc1/mm/page-writeback.c 2006-01-28 02:11:52.000000000 +0100 @@ -88,7 +88,8 @@ int block_dump;
/* - * Flag that puts the machine in "laptop mode". + * Flag that puts the machine in "laptop mode". Doubles as a timeout in jiffies: + * a full sync is triggered after this time elapses without any disk activity. */ int laptop_mode;
@@ -467,7 +468,7 @@ */ void laptop_io_completion(void) { - mod_timer(&laptop_mode_wb_timer, jiffies + laptop_mode * HZ); + mod_timer(&laptop_mode_wb_timer, jiffies + laptop_mode); }
/* - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |