> On Wed, Jul 31, 2013 at 04:02:29PM -0400, Mike Audia wrote:
> > I believe 30 sec is the default for the checkpoint interval. Is this adjustable?
>
> It doesn't look like it. It looks like it's implemented with raw '30's
> in the code.
>
> delay = HZ * 30;
> ...
> (now < cur->start_time || now - cur->start_time <
> 30)) {
>
> If you want more frequent forced commits you could always syncfs()
> regularly from userspace, I suppose.
Thank you kindly for the prompt reply. My goal is to make them _less_ frequent. I am NO programmer by any stretch. Let's say I want them to be once every 5 min (300 sec). Is the attached patch sane to acheive this? Are there any unforeseen and effects of doing this? Thank you for the consideration.
--- a/fs/btrfs/disk-io.c 2013-07-31 18:05:22.581062955 -0400
+++ b/fs/btrfs/disk-io.c 2013-07-31 18:06:15.243201652 -0400
@@ -1713,7 +1713,7 @@
do {
cannot_commit = false;
- delay = HZ * 30;
+ delay = HZ * 300;
mutex_lock(&root->fs_info->transaction_kthread_mutex);
spin_lock(&root->fs_info->trans_lock);
@@ -1725,7 +1725,7 @@
now = get_seconds();
if (!cur->blocked &&
- (now < cur->start_time || now - cur->start_time < 30)) {
+ (now < cur->start_time || now - cur->start_time < 300)) {
spin_unlock(&root->fs_info->trans_lock);
delay = HZ * 5;
goto sleep;