It has its own flush timer. This is something we need to crunch
on and think about.
There's an untested patch here which may suffice.
> There's a more general problem with VM on laptops which is that the system
> doesn't have any notion of spun-down disks. Flush intervals should be
> short when the disk is running and long when it isn't and decisions about
> which pages to discard or swap might be improvable. Pre-emptive swap when
> the disk is spun down is a loss..
Yup. The current VM is a bit too swap-happy, IMO. In try_to_free_pages(),
replace `priority = DEF_PRIORITY' with `priority = DEF_PRIORITY + 2'.
Also, if we had appropriate hooks into the request layer, we could detect
when the disk was being spun up for a read, and opporunistically flush
out any pending writes.
Tell me if this is joyful:
--- linux-2.4.15/fs/buffer.c Thu Nov 22 23:02:58 2001
+++ linux-akpm/fs/buffer.c Fri Nov 23 17:21:04 2001
@@ -119,6 +119,12 @@ union bdflush_param {
int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 1*HZ, 0, 0, 0};
int bdflush_max[N_PARAM] = {100,50000, 20000, 20000,10000*HZ, 6000*HZ, 100, 0, 0};
+int dirty_buffer_flush_interval(void)
+{
+ return bdf_prm.b_un.interval;
+}
+EXPORT_SYMBOL(dirty_buffer_flush_interval);
+
void unlock_buffer(struct buffer_head *bh)
{
clear_bit(BH_Wait_IO, &bh->b_state);
--- linux-2.4.15/fs/jbd/transaction.c Thu Nov 22 23:02:59 2001
+++ linux-akpm/fs/jbd/transaction.c Fri Nov 23 17:21:37 2001
@@ -43,6 +43,8 @@ extern spinlock_t journal_datalist_lock;
* processes trying to touch the journal while it is in transition.
*/
+extern int dirty_buffer_flush_interval(void);
+
static transaction_t * get_transaction (journal_t * journal, int is_try)
{
transaction_t * transaction;
@@ -56,7 +58,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 + dirty_buffer_flush_interval();
/* Set up the commit timer for the new transaction. */
J_ASSERT (!journal->j_commit_timer_active);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/