xfs
[Top] [All Lists]

[patch 1/1] Laptop mode for XFS (patch against CVS)

To: hch@xxxxxxxxxxxxx
Subject: [patch 1/1] Laptop mode for XFS (patch against CVS)
From: bart@xxxxxxxxx
Date: Mon, 05 Apr 2004 21:56:24 +0200
Cc: linux-xfs@xxxxxxxxxxx, bart@xxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
From: Bart Samwel <bart@xxxxxxxxx>

This is the same patch as earlier, but against the XFS CVS tree. Changelog:

* Increase maximums for age_buffer and sync_interval so that values useful for
  laptop-mode are within the allowed range.

* Switch from keeping track of "flush time" to keeping track of "creation time"
  for a pagebuf, so that changes in xfs_age_buffer can take effect immediately
  instead of only for pagebufs whose flush time is set anew.



---

 linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_buf.c     |    4 ++--
 linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_buf.h     |    2 +-
 linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_globals.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff -puN fs/xfs/linux-2.6/xfs_buf.c~xfs-laptop-mode fs/xfs/linux-2.6/xfs_buf.c
--- linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c~xfs-laptop-mode    2004-04-05 
21:50:26.000000000 +0200
+++ linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_buf.c    2004-04-05 
21:50:26.000000000 +0200
@@ -1497,7 +1497,7 @@ pagebuf_delwri_queue(
        }
 
        list_add_tail(&pb->pb_list, &pbd_delwrite_queue);
-       pb->pb_flushtime = jiffies + xfs_age_buffer;
+       pb->pb_creation_time = jiffies;
        spin_unlock(&pbd_delwrite_lock);
 
        if (unlock)
@@ -1569,7 +1569,7 @@ pagebuf_daemon(
 
                        if (!pagebuf_ispin(pb) && !pagebuf_cond_lock(pb)) {
                                if (!force_flush &&
-                                   time_before(jiffies, pb->pb_flushtime)) {
+                                   time_before(jiffies, pb->pb_creation_time + 
xfs_age_buffer)) {
                                        pagebuf_unlock(pb);
                                        break;
                                }
diff -puN fs/xfs/linux-2.6/xfs_buf.h~xfs-laptop-mode fs/xfs/linux-2.6/xfs_buf.h
--- linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.h~xfs-laptop-mode    2004-04-05 
21:50:26.000000000 +0200
+++ linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_buf.h    2004-04-05 
21:50:26.000000000 +0200
@@ -131,7 +131,7 @@ typedef int (*page_buf_bdstrat_t)(struct
 
 typedef struct xfs_buf {
        struct semaphore        pb_sema;        /* semaphore for lockables  */
-       unsigned long           pb_flushtime;   /* time to flush pagebuf    */
+       unsigned long           pb_creation_time; /* time pagebuf was created */
        atomic_t                pb_pin_count;   /* pin count                */
        wait_queue_head_t       pb_waiters;     /* unpin waiters            */
        struct list_head        pb_list;
diff -puN fs/xfs/linux-2.6/xfs_globals.c~xfs-laptop-mode 
fs/xfs/linux-2.6/xfs_globals.c
--- linux-2.6-xfs/fs/xfs/linux-2.6/xfs_globals.c~xfs-laptop-mode        
2004-04-05 21:50:26.000000000 +0200
+++ linux-2.6-xfs-bsamwel/fs/xfs/linux-2.6/xfs_globals.c        2004-04-05 
21:50:26.000000000 +0200
@@ -56,7 +56,7 @@ xfs_param_t xfs_params = {
        .symlink_mode   = {     0,      0,      1       },
        .panic_mask     = {     0,      0,      127     },
        .error_level    = {     0,      3,      11      },
-       .sync_interval  = {     HZ,     30*HZ,  60*HZ   },
+       .sync_interval  = {     HZ,     30*HZ,  7200*HZ },
        .probe_dmapi    = {     0,      1,      1       },
        .probe_ioops    = {     0,      0,      1       },
        .probe_quota    = {     0,      1,      1       },
@@ -65,7 +65,7 @@ xfs_param_t xfs_params = {
        .inherit_nodump = {     0,      1,      1       },
        .inherit_noatim = {     0,      1,      1       },
        .flush_interval = {     HZ/2,   HZ,     30*HZ   },
-       .age_buffer     = {     1*HZ,   15*HZ,  300*HZ  },
+       .age_buffer     = {     1*HZ,   15*HZ,  7200*HZ },
 };
 
 /*

_


<Prev in Thread] Current Thread [Next in Thread>