From patchwork Wed Jul 31 22:10:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Audia X-Patchwork-Id: 2836582 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 12B61C0319 for ; Wed, 31 Jul 2013 22:10:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C4C220214 for ; Wed, 31 Jul 2013 22:10:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48F7720213 for ; Wed, 31 Jul 2013 22:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757007Ab3GaWKL (ORCPT ); Wed, 31 Jul 2013 18:10:11 -0400 Received: from mout.gmx.net ([74.208.4.200]:59649 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752517Ab3GaWKK (ORCPT ); Wed, 31 Jul 2013 18:10:10 -0400 Received: from mailout-us.gmx.com ([172.19.198.46]) by mrigmx.server.lan (mrigmxus002) with ESMTP (Nemesis) id 0MWjWR-1UY2V02GgV-00XxCD for ; Thu, 01 Aug 2013 00:10:09 +0200 Received: (qmail 408 invoked by uid 0); 31 Jul 2013 22:10:09 -0000 Received: from 50.151.190.116 by rms-us020 with HTTP Cc: linux-btrfs@vger.kernel.org Date: Wed, 31 Jul 2013 18:10:08 -0400 From: "Mike Audia" Message-ID: <20130731221008.156770@gmx.com> MIME-Version: 1.0 Subject: Re: Is the checkpoint interval adjustable? To: "Zach Brown" X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 X-GMX-UID: F+6LcVlc3zOl2jiCCX4hAhJ+IGRvb4CH Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > 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;