changeset 5:f9102615898f default tip

remove some shouting in xfs, partial description of the vm changes
author Josef "Jeff" Sipek <jsipek@cs.sunysb.edu>
date Mon, 30 Jul 2007 18:28:18 -0400
parents 50a36843bc47
children
files debug-inactive-lists multiple-inactive_lists series xfs-remove-shouting xfs-save-buf-reference-count-as-page-weight
diffstat 5 files changed, 190 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debug-inactive-lists	Mon Jul 30 18:28:18 2007 -0400
@@ -0,0 +1,13 @@
+diff --git a/mm/vmscan.c b/mm/vmscan.c
+index c236999..c88acf8 100644
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -778,6 +778,8 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
+ 			     (sc->order > PAGE_ALLOC_COSTLY_ORDER)?
+ 					     ISOLATE_BOTH : ISOLATE_INACTIVE);
+ 		nr_active = clear_active_flags(&page_list);
++		if (unlikely(weight))
++			printk("MM: moving %d pages from the inactive list of weight %d\n", nr_taken, weight);
+ 
+ 		__mod_zone_page_state(zone, NR_ACTIVE, -nr_active);
+ 		__mod_zone_page_state(zone, NR_INACTIVE,
--- a/multiple-inactive_lists	Sun Jul 29 02:02:31 2007 -0400
+++ b/multiple-inactive_lists	Mon Jul 30 18:28:18 2007 -0400
@@ -1,3 +1,35 @@
+mm: Weighted page reclaim
+
+Use multiple inactive lists to implement weighted page reclaim.
+
+Long description & design justification:
+
+A number of systems use the page cache to store cached data. Not all of this
+cached data is equally important - for example, a filesystem's superblock is
+more important than a regular data block.
+
+The current implementation uses 2 LRU lists, one for active pages and one
+for inactive pages. This patch changes this to 1 active list, and
+NR_INACTIVE_LISTS inactive lists. Each page has an associated weight - the
+higher the weight the harder the reclaim must try to free such page.
+
+When a page is placed on one of the inactive lists, the weight is used as an
+index into the inactive list array. Newly set up pages have their weight set
+to 0, and therefore the behavior remains unchanged.
+
+When a page's weight is changed, the page remains on the same list (active
+or inactive) until the next time the page is moved to an inactive list.
+
+TODO:
+ - weight doesn't need 32-bits
+
+Cc: akpm?
+Cc: riel?
+Cc: peterz?
+Cc: sandeen?
+Cc: dchinner@sgi.com
+Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
+
 diff --git a/include/linux/mm.h b/include/linux/mm.h
 index a5c4518..fd79561 100644
 --- a/include/linux/mm.h
--- a/series	Sun Jul 29 02:02:31 2007 -0400
+++ b/series	Mon Jul 30 18:28:18 2007 -0400
@@ -8,7 +8,9 @@
 #
 multiple-inactive_lists
 rename-B_FS-flags
+xfs-remove-shouting
 xfs-save-buf-reference-count-as-page-weight
+debug-inactive-lists
 
 #
 # Misc cleanup
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xfs-remove-shouting	Mon Jul 30 18:28:18 2007 -0400
@@ -0,0 +1,130 @@
+diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
+index b5908a3..cb4c75f 100644
+--- a/fs/xfs/linux-2.6/xfs_buf.h
++++ b/fs/xfs/linux-2.6/xfs_buf.h
+@@ -324,9 +324,9 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
+ #define XFS_BUF_SIZE(bp)		((bp)->b_buffer_length)
+ #define XFS_BUF_SET_SIZE(bp, cnt)	((bp)->b_buffer_length = (cnt))
+ 
+-#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)	do { } while (0)
+-#define XFS_BUF_SET_VTYPE(bp, type)		do { } while (0)
+-#define XFS_BUF_SET_REF(bp, ref)		do { } while (0)
++#define xfs_buf_set_vtype_ref(bp, type, ref)	do { } while (0)
++#define xfs_buf_set_vtype(bp, type)		do { } while (0)
++#define xfs_buf_set_ref(bp, ref)		do { } while (0)
+ 
+ #define XFS_BUF_ISPINNED(bp)	xfs_buf_ispin(bp)
+ 
+diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
+index 421ded6..b173065 100644
+--- a/fs/xfs/quota/xfs_dquot.c
++++ b/fs/xfs/quota/xfs_dquot.c
+@@ -679,7 +679,7 @@ xfs_qm_dqread(
+ 	dqp->q_res_rtbcount = be64_to_cpu(ddqp->d_rtbcount);
+ 
+ 	/* Mark the buf so that this will stay incore a little longer */
+-	XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_DQUOT, XFS_DQUOT_REF);
++	xfs_buf_set_vtype_ref(bp, XFS_B_FS_DQUOT, XFS_DQUOT_REF);
+ 
+ 	/*
+ 	 * We got the buffer with a xfs_trans_read_buf() (in dqtobp())
+diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
+index 7923fc7..7abd571 100644
+--- a/fs/xfs/xfs_alloc.c
++++ b/fs/xfs/xfs_alloc.c
+@@ -409,7 +409,7 @@ xfs_alloc_read_agfl(
+ 		return error;
+ 	ASSERT(bp);
+ 	ASSERT(!XFS_BUF_GETERROR(bp));
+-	XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_AGFL, XFS_AGFL_REF);
++	xfs_buf_set_vtype_ref(bp, XFS_B_FS_AGFL, XFS_AGFL_REF);
+ 	*bpp = bp;
+ 	return 0;
+ }
+@@ -2222,7 +2222,7 @@ xfs_alloc_read_agf(
+ 		       be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]));
+ 	}
+ #endif
+-	XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_AGF, XFS_AGF_REF);
++	xfs_buf_set_vtype_ref(bp, XFS_B_FS_AGF, XFS_AGF_REF);
+ 	*bpp = bp;
+ 	return 0;
+ }
+diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
+index 0f67a42..7287fa2 100644
+--- a/fs/xfs/xfs_btree.c
++++ b/fs/xfs/xfs_btree.c
+@@ -760,7 +760,7 @@ xfs_btree_read_bufl(
+ 	}
+ 	ASSERT(!bp || !XFS_BUF_GETERROR(bp));
+ 	if (bp != NULL) {
+-		XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_MAP, refval);
++		xfs_buf_set_vtype_ref(bp, XFS_B_FS_MAP, refval);
+ 	}
+ 	*bpp = bp;
+ 	return 0;
+@@ -795,10 +795,10 @@ xfs_btree_read_bufs(
+ 	if (bp != NULL) {
+ 		switch (refval) {
+ 		case XFS_ALLOC_BTREE_REF:
+-			XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_MAP, refval);
++			xfs_buf_set_vtype_ref(bp, XFS_B_FS_MAP, refval);
+ 			break;
+ 		case XFS_INO_BTREE_REF:
+-			XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_INOMAP, refval);
++			xfs_buf_set_vtype_ref(bp, XFS_B_FS_INOMAP, refval);
+ 			break;
+ 		}
+ 	}
+diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
+index 62b8465..dfe2a62 100644
+--- a/fs/xfs/xfs_da_btree.c
++++ b/fs/xfs/xfs_da_btree.c
+@@ -2037,10 +2037,10 @@ xfs_da_do_buf(
+ 			continue;
+ 		if (caller == 1) {
+ 			if (whichfork == XFS_ATTR_FORK) {
+-				XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_ATTR_BTREE,
++				xfs_buf_set_vtype_ref(bp, XFS_B_FS_ATTR_BTREE,
+ 						XFS_ATTR_BTREE_REF);
+ 			} else {
+-				XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_DIR_BTREE,
++				xfs_buf_set_vtype_ref(bp, XFS_B_FS_DIR_BTREE,
+ 						XFS_DIR_BTREE_REF);
+ 			}
+ 		}
+diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
+index a62b923..f160d18 100644
+--- a/fs/xfs/xfs_ialloc.c
++++ b/fs/xfs/xfs_ialloc.c
+@@ -1408,7 +1408,7 @@ xfs_ialloc_read_agi(
+ 	}
+ #endif
+ 
+-	XFS_BUF_SET_VTYPE_REF(bp, XFS_B_FS_AGI, XFS_AGI_REF);
++	xfs_buf_set_vtype_ref(bp, XFS_B_FS_AGI, XFS_AGI_REF);
+ 	*bpp = bp;
+ 	return 0;
+ }
+diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
+index d2a66f5..df9eeb1 100644
+--- a/fs/xfs/xfs_inode.c
++++ b/fs/xfs/xfs_inode.c
+@@ -375,7 +375,7 @@ xfs_itobp(
+ 	/*
+ 	 * Mark the buffer as an inode buffer now that it looks good
+ 	 */
+-	XFS_BUF_SET_VTYPE(bp, XFS_B_FS_INO);
++	xfs_buf_set_vtype(bp, XFS_B_FS_INO);
+ 
+ 	/*
+ 	 * Set *dipp to point to the on-disk inode in the buffer.
+@@ -991,7 +991,7 @@ xfs_iread(
+ 	 * around for a while.  This helps to keep recently accessed
+ 	 * meta-data in-core longer.
+ 	 */
+-	 XFS_BUF_SET_REF(bp, XFS_INO_REF);
++	 xfs_buf_set_ref(bp, XFS_INO_REF);
+ 
+ 	/*
+ 	 * Use xfs_trans_brelse() to release the buffer containing the
--- a/xfs-save-buf-reference-count-as-page-weight	Sun Jul 29 02:02:31 2007 -0400
+++ b/xfs-save-buf-reference-count-as-page-weight	Mon Jul 30 18:28:18 2007 -0400
@@ -7,7 +7,7 @@
 Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
 
 diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
-index b5908a3..f5e0862 100644
+index cb4c75f..7170706 100644
 --- a/fs/xfs/linux-2.6/xfs_buf.h
 +++ b/fs/xfs/linux-2.6/xfs_buf.h
 @@ -31,6 +31,19 @@
@@ -38,19 +38,19 @@
  	xfs_buf_flags_t		b_flags;	/* status flags */
  	struct list_head	b_hash_list;	/* hash table list */
  	xfs_bufhash_t		*b_hash;	/* hash table list start */
-@@ -324,9 +338,26 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
+@@ -324,10 +338,27 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
  #define XFS_BUF_SIZE(bp)		((bp)->b_buffer_length)
  #define XFS_BUF_SET_SIZE(bp, cnt)	((bp)->b_buffer_length = (cnt))
  
--#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)	do { } while (0)
--#define XFS_BUF_SET_VTYPE(bp, type)		do { } while (0)
--#define XFS_BUF_SET_REF(bp, ref)		do { } while (0)
-+static inline void XFS_BUF_SET_VTYPE(xfs_buf_t *bp, xfs_bvtype_t type)
+-#define xfs_buf_set_vtype_ref(bp, type, ref)	do { } while (0)
+-#define xfs_buf_set_vtype(bp, type)		do { } while (0)
+-#define xfs_buf_set_ref(bp, ref)		do { } while (0)
++static inline void xfs_buf_set_vtype(xfs_buf_t *bp, xfs_bvtype_t type)
 +{
 +	bp->b_type = type;
 +}
 +
-+static inline void XFS_BUF_SET_REF(xfs_buf_t *bp, char ref)
++static inline void xfs_buf_set_ref(xfs_buf_t *bp, char ref)
 +{
 +	int i;
 +	int weight = (ref > 1) ? (NR_INACTIVE_LISTS - 1) : 0;
@@ -58,13 +58,14 @@
 +	for (i = 0; i < bp->b_page_count; i++)
 +		set_page_weight(bp->b_pages[i], weight);
 +}
-+
-+static inline void XFS_BUF_SET_VTYPE_REF(xfs_buf_t *bp, xfs_bvtype_t type,
+ 
++static inline void xfs_buf_set_vtype_ref(xfs_buf_t *bp, xfs_bvtype_t type,
 +					 char ref)
 +{
-+	XFS_BUF_SET_VTYPE(bp, type);
-+	XFS_BUF_SET_REF(bp, ref);
++	xfs_buf_set_vtype(bp, type);
++	xfs_buf_set_ref(bp, ref);
 +}
- 
++ 
  #define XFS_BUF_ISPINNED(bp)	xfs_buf_ispin(bp)
  
+ #define XFS_BUF_VALUSEMA(bp)	xfs_buf_lock_value(bp)