All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mike Audia" <mikey_a@gmx.com>
To: "Zach Brown" <zab@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Is the checkpoint interval adjustable?
Date: Wed, 31 Jul 2013 18:10:08 -0400	[thread overview]
Message-ID: <20130731221008.156770@gmx.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

> 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.

[-- Attachment #2: Attachment: 10_minute_checkpoints.patch --]
[-- Type: text/x-patch, Size: 604 bytes --]

--- 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;

             reply	other threads:[~2013-07-31 22:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 22:10 Mike Audia [this message]
2013-07-31 22:56 ` Is the checkpoint interval adjustable? Zach Brown
2013-08-01 15:40   ` David Sterba
2013-08-01 17:59     ` Zach Brown
     [not found] ` <20130731225640.GO32145@lenny. home.zabbo.net>
2013-08-01  3:11   ` Duncan
  -- strict thread matches above, loose matches on Subject: below --
2013-08-02 20:58 Mike Audia
2013-08-03  8:33 ` Duncan
2013-07-31 20:02 Mike Audia
2013-07-31 20:54 ` Zach Brown
2013-08-03 17:28 ` Kai Krakow
2013-08-03 17:37   ` Torbjørn
2013-08-04  0:58     ` Kai Krakow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130731221008.156770@gmx.com \
    --to=mikey_a@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.