Received: with ECARTIS (v1.0.0; list linux-xfs); Mon, 05 Apr 2004 01:33:58 -0700 (PDT) Received: from samwel.tk (kluizenaar.xs4all.nl [213.84.184.247]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i358XsKO030294 for ; Mon, 5 Apr 2004 01:33:54 -0700 Received: from localhost ([127.0.0.1] helo=samwel.tk) by samwel.tk with esmtp (Exim 4.30) id 1BAPYE-0006AU-MP; Mon, 05 Apr 2004 10:33:50 +0200 Message-ID: <407119EB.4050101@samwel.tk> Date: Mon, 05 Apr 2004 10:33:47 +0200 From: Bart Samwel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: nl, en-us, en MIME-Version: 1.0 To: Christoph Hellwig CC: linux-xfs@oss.sgi.com Subject: Re: [patch 1/1] Make XFS sysctl parameters use USER_HZ instead of HZ. References: <20040405083839.A2647@infradead.org> In-Reply-To: <20040405083839.A2647@infradead.org> Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: bart@samwel.tk X-SA-Exim-Scanned: No (on samwel.tk); SAEximRunCond expanded to false X-archive-position: 2750 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: bart@samwel.tk Precedence: bulk X-list: linux-xfs Content-Length: 1533 Lines: 41 Christoph Hellwig wrote: > On Sat, Apr 03, 2004 at 01:12:40PM +0200, bart@samwel.tk wrote: > >>From: Bart Samwel >> >>The sysctl parameters sync_interval, flush_interval and age_buffer are >>in units of jiffies, which are very variable between kernels and >>architectures. These parameters should use USER_HZ, which is meant for >>use in external interfaces. >> >>Rationale: If there is no interface with a reliable unit, the laptop mode >>control script can never work reliably, because it then needs to know the >>value of HZ, which is intentionally not exported from the kernel anywhere. >> >>Possible improvement (matter of taste): renaming the variables, so that >>old code knows that the new variables are in new units. I suggest to not >>do this, because the variables previously didn't have any usable unit >>anyway. Any code that was written against this interface had to assume >>some HZ and would _have_ to have known that it would break with _any_ >>change in HZ. > > > I think this is problematic because schedule_timeout() expects these in > units of HZ. So you need to re-unit them somewhere in the sysctl handler, > IIRC the networking folks even added special sysctl handlers that do it > automatically. The reunit code is there, e.g., for the sync interval there is: -#define xfs_syncd_interval xfs_params.sync_interval.val +#define xfs_syncd_interval (xfs_params.sync_interval.val * HZ / USER_HZ) So the xfs_params.XXX values are in USER_HZ, but the xfs_XXX values are in HZ. --Bart