xfs
[Top] [All Lists]

[patch 1/2] From: Bart Samwel <bart@xxxxxxxxx>

To: linux-xfs@xxxxxxxxxxx
Subject: [patch 1/2] From: Bart Samwel <bart@xxxxxxxxx>
From: bart@xxxxxxxxx
Date: Sat, 03 Apr 2004 15:36:09 +0200
Sender: linux-xfs-bounce@xxxxxxxxxxx

Add laptop mode support for XFS.

* 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.4-bsamwel/fs/xfs/linux/xfs_buf.c     |    4 ++--
 linux-2.6.4-bsamwel/fs/xfs/linux/xfs_buf.h     |    2 +-
 linux-2.6.4-bsamwel/fs/xfs/linux/xfs_globals.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff -puN fs/xfs/linux/xfs_buf.c~xfs-laptop-mode fs/xfs/linux/xfs_buf.c
--- linux-2.6.4/fs/xfs/linux/xfs_buf.c~xfs-laptop-mode  2004-04-02 
12:45:39.000000000 +0200
+++ linux-2.6.4-bsamwel/fs/xfs/linux/xfs_buf.c  2004-04-03 10:31:04.000000000 
+0200
@@ -1574,7 +1574,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)
@@ -1647,7 +1647,7 @@ pagebuf_daemon(
                        if ((pb->pb_flags & PBF_DELWRI) &&
                             !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/xfs_buf.h~xfs-laptop-mode fs/xfs/linux/xfs_buf.h
--- linux-2.6.4/fs/xfs/linux/xfs_buf.h~xfs-laptop-mode  2004-04-02 
12:45:39.000000000 +0200
+++ linux-2.6.4-bsamwel/fs/xfs/linux/xfs_buf.h  2004-04-02 12:45:39.000000000 
+0200
@@ -139,7 +139,7 @@ typedef int (*page_buf_bdstrat_t)(struct
 
 typedef struct page_buf_s {
        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/xfs_globals.c~xfs-laptop-mode fs/xfs/linux/xfs_globals.c
--- linux-2.6.4/fs/xfs/linux/xfs_globals.c~xfs-laptop-mode      2004-04-02 
12:45:39.000000000 +0200
+++ linux-2.6.4-bsamwel/fs/xfs/linux/xfs_globals.c      2004-04-02 
12:45:39.000000000 +0200
@@ -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  = {     HZ,     30*HZ,  60*HZ   },
+       .sync_interval  = {     HZ,     30*HZ,  7200*HZ },
        .stats_clear    = {     0,      0,      1       },
        .inherit_sync   = {     0,      1,      1       },
        .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>