Commit 1f2a36f1 authored by Nathan Scott's avatar Nathan Scott

[XFS] Export/import tunable time intervals as centisecs not jiffies.

SGI Modid: xfs-linux:xfs-kern:171825a
parent 823f57cd
......@@ -1596,6 +1596,7 @@ pagebuf_daemon(
void *data)
{
struct list_head tmp;
unsigned long age;
xfs_buf_t *pb, *n;
/* Set up the thread */
......@@ -1613,8 +1614,9 @@ pagebuf_daemon(
refrigerator(PF_FREEZE);
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(xfs_flush_interval);
schedule_timeout((xfs_buf_timer_centisecs * HZ) / 100);
age = (xfs_buf_age_centisecs * HZ) / 100;
spin_lock(&pbd_delwrite_lock);
list_for_each_entry_safe(pb, n, &pbd_delwrite_queue, pb_list) {
PB_TRACE(pb, "walkq1", (long)pagebuf_ispin(pb));
......@@ -1623,8 +1625,7 @@ pagebuf_daemon(
if (!pagebuf_ispin(pb) && !pagebuf_cond_lock(pb)) {
if (!force_flush &&
time_before(jiffies,
pb->pb_queuetime +
xfs_age_buffer)) {
pb->pb_queuetime + age)) {
pagebuf_unlock(pb);
break;
}
......
......@@ -46,9 +46,9 @@ unsigned long xfs_physmem;
/*
* Tunable XFS parameters. xfs_params is required even when CONFIG_SYSCTL=n,
* other XFS code uses these values.
* other XFS code uses these values. Times are measured in centisecs (i.e.
* 100ths of a second).
*/
xfs_param_t xfs_params = {
/* MIN DFLT MAX */
.restrict_chown = { 0, 1, 1 },
......@@ -56,13 +56,13 @@ xfs_param_t xfs_params = {
.symlink_mode = { 0, 0, 1 },
.panic_mask = { 0, 0, 127 },
.error_level = { 0, 3, 11 },
.sync_interval = { USER_HZ, 30*USER_HZ, 7200*USER_HZ },
.syncd_timer = { 1*100, 30*100, 7200*100},
.stats_clear = { 0, 0, 1 },
.inherit_sync = { 0, 1, 1 },
.inherit_nodump = { 0, 1, 1 },
.inherit_noatim = { 0, 1, 1 },
.flush_interval = { USER_HZ/2, USER_HZ, 30*USER_HZ },
.age_buffer = { 1*USER_HZ, 15*USER_HZ, 7200*USER_HZ },
.xfs_buf_timer = { 100/2, 1*100, 30*100 },
.xfs_buf_age = { 1*100, 15*100, 7200*100},
};
/*
......
/*
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
......@@ -128,20 +128,18 @@ static inline void set_buffer_unwritten_io(struct buffer_head *bh)
bh->b_end_io = linvfs_unwritten_done;
}
#define xfs_refcache_size xfs_params.refcache_size.val
#define xfs_refcache_purge_count xfs_params.refcache_purge.val
#define restricted_chown xfs_params.restrict_chown.val
#define irix_sgid_inherit xfs_params.sgid_inherit.val
#define irix_symlink_mode xfs_params.symlink_mode.val
#define xfs_panic_mask xfs_params.panic_mask.val
#define xfs_error_level xfs_params.error_level.val
#define xfs_syncd_interval (xfs_params.sync_interval.val * HZ / USER_HZ)
#define xfs_syncd_centisecs xfs_params.syncd_timer.val
#define xfs_stats_clear xfs_params.stats_clear.val
#define xfs_inherit_sync xfs_params.inherit_sync.val
#define xfs_inherit_nodump xfs_params.inherit_nodump.val
#define xfs_inherit_noatime xfs_params.inherit_noatim.val
#define xfs_flush_interval (xfs_params.flush_interval.val * HZ / USER_HZ)
#define xfs_age_buffer (xfs_params.age_buffer.val * HZ / USER_HZ)
#define xfs_buf_timer_centisecs xfs_params.xfs_buf_timer.val
#define xfs_buf_age_centisecs xfs_params.xfs_buf_age.val
#define current_cpu() smp_processor_id()
#define current_pid() (current->pid)
......
......@@ -392,7 +392,7 @@ xfssyncd(
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(xfs_syncd_interval);
schedule_timeout((xfs_syncd_centisecs * HZ) / 100);
/* swsusp */
if (current->flags & PF_FREEZE)
refrigerator(PF_FREEZE);
......
/*
* Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2001-2004 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
......@@ -98,10 +98,10 @@ STATIC ctl_table xfs_table[] = {
&sysctl_intvec, NULL,
&xfs_params.error_level.min, &xfs_params.error_level.max},
{XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.sync_interval.val,
{XFS_SYNCD_TIMER, "xfssyncd_centisecs", &xfs_params.syncd_timer.val,
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.sync_interval.min, &xfs_params.sync_interval.max},
&xfs_params.syncd_timer.min, &xfs_params.syncd_timer.max},
{XFS_INHERIT_SYNC, "inherit_sync", &xfs_params.inherit_sync.val,
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
......@@ -118,15 +118,15 @@ STATIC ctl_table xfs_table[] = {
&sysctl_intvec, NULL,
&xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max},
{XFS_FLUSH_INTERVAL, "flush_interval", &xfs_params.flush_interval.val,
{XFS_BUF_TIMER, "xfsbufd_centisecs", &xfs_params.xfs_buf_timer.val,
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.flush_interval.min, &xfs_params.flush_interval.max},
&xfs_params.xfs_buf_timer.min, &xfs_params.xfs_buf_timer.max},
{XFS_AGE_BUFFER, "age_buffer", &xfs_params.age_buffer.val,
{XFS_BUF_AGE, "age_buffer_centisecs", &xfs_params.xfs_buf_age.val,
sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.age_buffer.min, &xfs_params.age_buffer.max},
&xfs_params.xfs_buf_age.min, &xfs_params.xfs_buf_age.max},
/* please keep this the last entry */
#ifdef CONFIG_PROC_FS
......
/*
* Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2001-2004 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
......@@ -47,21 +47,18 @@ typedef struct xfs_sysctl_val {
typedef struct xfs_param {
xfs_sysctl_val_t restrict_chown;/* Root/non-root can give away files.*/
xfs_sysctl_val_t sgid_inherit; /* Inherit S_ISGID bit if process' GID
* is not a member of the parent dir
* GID */
xfs_sysctl_val_t sgid_inherit; /* Inherit S_ISGID if process' GID is
* not a member of parent dir GID. */
xfs_sysctl_val_t symlink_mode; /* Link creat mode affected by umask */
xfs_sysctl_val_t panic_mask; /* bitmask to cause panic on errors. */
xfs_sysctl_val_t error_level; /* Degree of reporting for problems */
xfs_sysctl_val_t sync_interval; /* time between sync calls */
xfs_sysctl_val_t syncd_timer; /* Interval between xfssyncd wakeups */
xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */
xfs_sysctl_val_t inherit_sync; /* Inherit the "sync" inode flag. */
xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */
xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */
xfs_sysctl_val_t flush_interval;/* interval between runs of the
* delwri flush daemon. */
xfs_sysctl_val_t age_buffer; /* time for buffer to age before
* we flush it. */
xfs_sysctl_val_t xfs_buf_timer; /* Interval between xfsbufd wakeups. */
xfs_sysctl_val_t xfs_buf_age; /* Metadata buffer age before flush. */
} xfs_param_t;
/*
......@@ -80,18 +77,24 @@ typedef struct xfs_param {
*/
enum {
/* XFS_REFCACHE_SIZE = 1 */
/* XFS_REFCACHE_PURGE = 2 */
XFS_RESTRICT_CHOWN = 3,
XFS_SGID_INHERIT = 4,
XFS_SYMLINK_MODE = 5,
XFS_PANIC_MASK = 6,
XFS_ERRLEVEL = 7,
XFS_SYNC_INTERVAL = 8,
XFS_SYNCD_TIMER = 8,
/* XFS_PROBE_DMAPI = 9 */
/* XFS_PROBE_IOOPS = 10 */
/* XFS_PROBE_QUOTA = 11 */
XFS_STATS_CLEAR = 12,
XFS_INHERIT_SYNC = 13,
XFS_INHERIT_NODUMP = 14,
XFS_INHERIT_NOATIME = 15,
XFS_FLUSH_INTERVAL = 16,
XFS_AGE_BUFFER = 17,
XFS_BUF_TIMER = 16,
XFS_BUF_AGE = 17,
/* XFS_IO_BYPASS = 18 */
};
extern xfs_param_t xfs_params;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment