--- ./fs/jbd/journal.c.~1~ Thu Jun 6 17:31:36 2002 +++ ./fs/jbd/journal.c Thu Jun 6 17:51:34 2002 @@ -224,7 +224,7 @@ int kjournald(void *arg) wake_up(&journal->j_wait_done_commit); printk(KERN_INFO "kjournald starting. Commit interval %ld seconds\n", - journal->j_commit_interval / HZ); + bdflush_interval / HZ); list_add(&journal->j_all_journals, &all_journals); /* And now, wait forever for commit wakeup events. */ @@ -707,8 +707,6 @@ static journal_t * journal_init_common ( init_MUTEX(&journal->j_checkpoint_sem); init_MUTEX(&journal->j_sem); - journal->j_commit_interval = (HZ * 5); - /* The journal is marked for error until we succeed with recovery! */ journal->j_flags = JFS_ABORT; --- ./fs/jbd/transaction.c.~1~ Thu Jun 6 17:31:36 2002 +++ ./fs/jbd/transaction.c Thu Jun 6 17:51:43 2002 @@ -56,7 +56,7 @@ static transaction_t * get_transaction ( transaction->t_journal = journal; transaction->t_state = T_RUNNING; transaction->t_tid = journal->j_transaction_sequence++; - transaction->t_expires = jiffies + journal->j_commit_interval; + transaction->t_expires = jiffies + bdflush_interval; /* Set up the commit timer for the new transaction. */ J_ASSERT (!journal->j_commit_timer_active); --- ./fs/buffer.c.~1~ Thu Jun 6 17:31:40 2002 +++ ./fs/buffer.c Thu Jun 6 17:50:56 2002 @@ -93,37 +93,11 @@ static void __remove_from_lru_list(struc /* This is used by some architectures to estimate available memory. */ atomic_t buffermem_pages = ATOMIC_INIT(0); -/* Here is the parameter block for the bdflush process. If you add or - * remove any of the parameters, make sure to update kernel/sysctl.c - * and the documentation at linux/Documentation/sysctl/vm.txt. - */ - -#define N_PARAM 9 - -/* The dummy values in this structure are left in there for compatibility - * with old programs that play with the /proc entries. - */ -union bdflush_param { - struct { - int nfract; /* Percentage of buffer cache dirty to - activate bdflush */ - int ndirty; /* Maximum number of dirty blocks to write out per - wake-cycle */ - int dummy2; /* old "nrefill" */ - int dummy3; /* unused */ - int interval; /* jiffies delay between kupdate flushes */ - int age_buffer; /* Time for normal buffer to age before we flush it */ - int nfract_sync;/* Percentage of buffer cache dirty to - activate bdflush synchronously */ - int nfract_stop_bdflush; /* Percetange of buffer cache dirty to stop bdflush */ - int dummy5; /* unused */ - } b_un; - unsigned int data[N_PARAM]; -} bdf_prm = {{50, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; +union bdflush_param bdf_prm = {{50, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; /* These are the min and max parameter values that we will allow to be assigned */ -int bdflush_min[N_PARAM] = { 0, 1, 0, 0, 0, 1*HZ, 0, 0, 0}; -int bdflush_max[N_PARAM] = {100,50000, 20000, 20000,10000*HZ, 10000*HZ, 100, 100, 0}; +int bdflush_min[BDFLUSH_NR_PARAM] = { 0, 1, 0, 0, 0, 1*HZ, 0, 0, 0}; +int bdflush_max[BDFLUSH_NR_PARAM] = {100,50000, 20000, 20000,10000*HZ, 10000*HZ, 100, 100, 0}; static void @@ -2950,7 +2924,7 @@ asmlinkage long sys_bdflush(int func, lo /* Basically func 1 means read param 1, 2 means write param 1, etc */ if (func >= 2) { int i = (func-2) >> 1; - if (i >= 0 && i < N_PARAM) { + if (i >= 0 && i < BDFLUSH_NR_PARAM) { if ((func & 1) == 0) return put_user(bdf_prm.data[i], (int*)data); @@ -3039,7 +3013,7 @@ int kupdate(void *startup) for (;;) { /* update interval */ - interval = bdf_prm.b_un.interval; + interval = bdflush_interval; if (interval) { tsk->state = TASK_INTERRUPTIBLE; schedule_timeout(interval); --- ./include/linux/jbd.h.~1~ Tue Jun 4 06:12:12 2002 +++ ./include/linux/jbd.h Thu Jun 6 17:55:49 2002 @@ -522,10 +522,6 @@ struct journal_s * compound commit transaction */ int j_max_transaction_buffers; - /* What is the maximum transaction lifetime before we begin a - * commit? */ - unsigned long j_commit_interval; - /* The timer used to wakeup the commit thread: */ struct timer_list * j_commit_timer; int j_commit_timer_active; --- ./include/linux/fs.h.~1~ Thu Jun 6 17:31:40 2002 +++ ./include/linux/fs.h Thu Jun 6 17:50:37 2002 @@ -215,6 +215,37 @@ extern int leases_enable, dir_notify_ena #include #include +/* Here is the parameter block for the bdflush process. If you add or + * remove any of the parameters, make sure to update kernel/sysctl.c + * and the documentation at linux/Documentation/sysctl/vm.txt. + */ + +#define BDFLUSH_NR_PARAM 9 + +/* The dummy values in this structure are left in there for compatibility + * with old programs that play with the /proc entries. + */ +union bdflush_param { + struct { + int nfract; /* Percentage of buffer cache dirty to + activate bdflush */ + int ndirty; /* Maximum number of dirty blocks to write out per + wake-cycle */ + int dummy2; /* old "nrefill" */ + int dummy3; /* unused */ + int interval; /* jiffies delay between kupdate flushes */ + int age_buffer; /* Time for normal buffer to age before we flush it */ + int nfract_sync;/* Percentage of buffer cache dirty to + activate bdflush synchronously */ + int nfract_stop_bdflush; /* Percetange of buffer cache dirty to stop bdflush */ + int dummy5; /* unused */ + } b_un; + unsigned int data[BDFLUSH_NR_PARAM]; +}; +extern union bdflush_param bdf_prm; +#define bdflush_interval (bdf_prm.b_un.interval) + + extern void update_atime (struct inode *); #define UPDATE_ATIME(inode) update_atime (inode) --- ./include/linux/ext3_fs_sb.h.~1~ Fri May 31 20:48:51 2002 +++ ./include/linux/ext3_fs_sb.h Thu Jun 6 17:55:36 2002 @@ -67,7 +67,6 @@ struct ext3_sb_info { struct inode * s_journal_inode; struct journal_s * s_journal; struct list_head s_orphan; - unsigned long s_commit_interval; struct block_device *journal_bdev; #ifdef CONFIG_JBD_DEBUG struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ --- ./kernel/sysctl.c.~1~ Thu Jun 6 17:31:37 2002 +++ ./kernel/sysctl.c Thu Jun 6 17:48:32 2002 @@ -43,7 +43,7 @@ /* External variables not in a header file. */ extern int panic_timeout; extern int C_A_D; -extern int bdf_prm[], bdflush_min[], bdflush_max[]; +extern int bdflush_min[], bdflush_max[]; extern int sysctl_overcommit_memory; extern int max_threads; extern atomic_t nr_queued_signals; @@ -273,7 +273,7 @@ static ctl_table vm_table[] = { &vm_lru_balance_ratio, sizeof(int), 0644, NULL, &proc_dointvec}, {VM_PASSES, "vm_passes", &vm_passes, sizeof(int), 0644, NULL, &proc_dointvec}, - {VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0644, NULL, + {VM_BDFLUSH, "bdflush", &bdf_prm, BDFLUSH_NR_PARAM*sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &bdflush_min, &bdflush_max}, {VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory,