linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility
@ 2007-04-30 18:55 Mel Gorman
  2007-04-30 18:55 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage on m68knommu Mel Gorman
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 18:55 UTC (permalink / raw)
  To: clameter; +Cc: Mel Gorman, linux-mm

Hi Christoph,

The following patches are the starting point for addressing points brought
up by your review of the grouping pages by mobility patches.  The main
intention of the patches are to make the usage of GFP flags that group pages
by mobility clearer.

The first patch fixes a problem on m68knommu where
alloc_zeroed_user_highpage_movable() was not fixed up properly. This is a
bug fix that was found while developing the second patch. It needs to be
applied regardless of the remaining patches so I'll be pushing this separetly.

The second patch removes alloc_zeroed_user_highpage() as there
are no in-tree users. External users should be migrated to use
alloc_zeroed_user_highpage_movable(). The function is not marked deprecated
because it was not generating the appropriate gcc warnings.

The third patch uses SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE
should be used instead of updating individual call sites.

The final patch defines __GFP_TEMPORARY, GFP_TEMPORARY and SLAB_TEMPORARY
for short-lived allocations. Currently __GFP_RECLAIMABLE is used to mean
both reclaimable and short-lived which can be confusing when reading the
call-sites using __GFP_RECLAIMABLE. This patch does not change the final
destination for the pages, but clarifies the callers intent should we wish
to change it later.

Credit goes to Andy Whitcroft for reviewing these before sending out.

Regression tests are currently underway but the risk should be low as
there is no functionalty change as such. Two tests on x86_64 have completed
successfully and I see no reason why any other machine will fail. Please review.

Thanks a lot for your time.
-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] Fix alloc_zeroed_user_highpage on m68knommu
  2007-04-30 18:55 [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility Mel Gorman
@ 2007-04-30 18:55 ` Mel Gorman
  2007-04-30 18:56 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 18:55 UTC (permalink / raw)
  To: clameter; +Cc: Mel Gorman, linux-mm

The patch
add-__gfp_movable-for-callers-to-flag-allocations-from-high-memory-that-may-be-migrated.patch
missed updating m68knommu where alloc_zeroed_user_highpage() changed to
alloc_zeroed_user_highpage_movable(). This patch fixes the problem.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---

 page.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-clean/include/asm-m68knommu/page.h linux-2.6.21-rc7-mm2-000_m68knommu/include/asm-m68knommu/page.h
--- linux-2.6.21-rc7-mm2-clean/include/asm-m68knommu/page.h	2007-04-16 00:50:57.000000000 +0100
+++ linux-2.6.21-rc7-mm2-000_m68knommu/include/asm-m68knommu/page.h	2007-04-30 16:04:31.000000000 +0100
@@ -22,7 +22,8 @@
 #define clear_user_page(page, vaddr, pg)	clear_page(page)
 #define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
 
-#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
+#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
+	alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
 #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
 
 /*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/4] Remove alloc_zeroed_user_highpage()
  2007-04-30 18:55 [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility Mel Gorman
  2007-04-30 18:55 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage on m68knommu Mel Gorman
@ 2007-04-30 18:56 ` Mel Gorman
  2007-04-30 18:56 ` [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
  2007-04-30 18:56 ` [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
  3 siblings, 0 replies; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 18:56 UTC (permalink / raw)
  To: clameter; +Cc: Mel Gorman, linux-mm

alloc_zeroed_user_highpage() has no in-tree users and it is not exported.
Rather than marking it __deprecated, this patch deletes the function.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---

 highmem.h |   15 ---------------
 1 files changed, 15 deletions(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-000_m68knommu/include/linux/highmem.h linux-2.6.21-rc7-mm2-001_deprecate/include/linux/highmem.h
--- linux-2.6.21-rc7-mm2-000_m68knommu/include/linux/highmem.h	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-001_deprecate/include/linux/highmem.h	2007-04-30 16:06:24.000000000 +0100
@@ -98,21 +98,6 @@ __alloc_zeroed_user_highpage(gfp_t movab
 #endif
 
 /**
- * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA
- * @vma: The VMA the page is to be allocated for
- * @vaddr: The virtual address the page will be inserted into
- *
- * This function will allocate a page for a VMA that the caller knows will
- * not be able to move in the future using move_pages() or reclaim. If it
- * is known that the page can move, use alloc_zeroed_user_highpage_movable
- */
-static inline struct page *
-alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
-{
-	return __alloc_zeroed_user_highpage(0, vma, vaddr);
-}
-
-/**
  * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
  * @vma: The VMA the page is to be allocated for
  * @vaddr: The virtual address the page will be inserted into

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used
  2007-04-30 18:55 [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility Mel Gorman
  2007-04-30 18:55 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage on m68knommu Mel Gorman
  2007-04-30 18:56 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
@ 2007-04-30 18:56 ` Mel Gorman
  2007-04-30 19:02   ` Christoph Lameter
  2007-04-30 18:56 ` [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
  3 siblings, 1 reply; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 18:56 UTC (permalink / raw)
  To: clameter; +Cc: Mel Gorman, linux-mm

A number of slab caches are reclaimable and some of their allocation
callsites were updated to use the __GFP_RECLAIMABLE flag. However, slabs
that are reclaimable specify the SLAB_ACCOUNT_RECLAIM flag at creation time
and this information is available at the time of page allocation.

This patch uses the SLAB_ACCOUNT_RECLAIM flag in the SLAB and SLUB
allocators to determine if __GFP_RECLAIMABLE should be used when allocating
pages. The SLOB allocator is not updated as it is unlikely to be used on
a system where grouping pages by mobility is worthwhile. The callsites
for reclaimable cache allocations  no longer specify __GFP_RECLAIMABLE
as the information is redundant. This can be considered as fix to
group-short-lived-and-reclaimable-kernel-allocations.patch.

Credit goes to Christoph Lameter for identifying this problem during review
and suggesting this fix.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---

 fs/dcache.c         |    2 +-
 fs/ext2/super.c     |    3 +--
 fs/ext3/super.c     |    2 +-
 fs/ntfs/inode.c     |    4 ++--
 fs/reiserfs/super.c |    3 +--
 mm/slab.c           |    2 ++
 mm/slub.c           |    3 +++
 7 files changed, 11 insertions(+), 8 deletions(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/fs/dcache.c linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/dcache.c
--- linux-2.6.21-rc7-mm2-001_deprecate/fs/dcache.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/dcache.c	2007-04-30 16:08:39.000000000 +0100
@@ -904,7 +904,7 @@ struct dentry *d_alloc(struct dentry * p
 	struct dentry *dentry;
 	char *dname;
 
-	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL|__GFP_RECLAIMABLE);
+	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL);
 	if (!dentry)
 		return NULL;
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/fs/ext2/super.c linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ext2/super.c
--- linux-2.6.21-rc7-mm2-001_deprecate/fs/ext2/super.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ext2/super.c	2007-04-30 16:22:29.000000000 +0100
@@ -140,8 +140,7 @@ static struct kmem_cache * ext2_inode_ca
 static struct inode *ext2_alloc_inode(struct super_block *sb)
 {
 	struct ext2_inode_info *ei;
-	ei = (struct ext2_inode_info *)kmem_cache_alloc(ext2_inode_cachep,
-						GFP_KERNEL|__GFP_RECLAIMABLE);
+	ei = (struct ext2_inode_info *)kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
 	if (!ei)
 		return NULL;
 #ifdef CONFIG_EXT2_FS_POSIX_ACL
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/fs/ext3/super.c linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ext3/super.c
--- linux-2.6.21-rc7-mm2-001_deprecate/fs/ext3/super.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ext3/super.c	2007-04-30 16:08:39.000000000 +0100
@@ -445,7 +445,7 @@ static struct inode *ext3_alloc_inode(st
 {
 	struct ext3_inode_info *ei;
 
-	ei = kmem_cache_alloc(ext3_inode_cachep, GFP_NOFS|__GFP_RECLAIMABLE);
+	ei = kmem_cache_alloc(ext3_inode_cachep, GFP_NOFS);
 	if (!ei)
 		return NULL;
 #ifdef CONFIG_EXT3_FS_POSIX_ACL
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/fs/ntfs/inode.c linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ntfs/inode.c
--- linux-2.6.21-rc7-mm2-001_deprecate/fs/ntfs/inode.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/ntfs/inode.c	2007-04-30 16:08:39.000000000 +0100
@@ -323,7 +323,7 @@ struct inode *ntfs_alloc_big_inode(struc
 	ntfs_inode *ni;
 
 	ntfs_debug("Entering.");
-	ni = kmem_cache_alloc(ntfs_big_inode_cache, GFP_NOFS|__GFP_RECLAIMABLE);
+	ni = kmem_cache_alloc(ntfs_big_inode_cache, GFP_NOFS);
 	if (likely(ni != NULL)) {
 		ni->state = 0;
 		return VFS_I(ni);
@@ -348,7 +348,7 @@ static inline ntfs_inode *ntfs_alloc_ext
 	ntfs_inode *ni;
 
 	ntfs_debug("Entering.");
-	ni = kmem_cache_alloc(ntfs_inode_cache, GFP_NOFS|__GFP_RECLAIMABLE);
+	ni = kmem_cache_alloc(ntfs_inode_cache, GFP_NOFS);
 	if (likely(ni != NULL)) {
 		ni->state = 0;
 		return ni;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/fs/reiserfs/super.c linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/reiserfs/super.c
--- linux-2.6.21-rc7-mm2-001_deprecate/fs/reiserfs/super.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/reiserfs/super.c	2007-04-30 16:08:39.000000000 +0100
@@ -496,8 +496,7 @@ static struct inode *reiserfs_alloc_inod
 {
 	struct reiserfs_inode_info *ei;
 	ei = (struct reiserfs_inode_info *)
-	    kmem_cache_alloc(reiserfs_inode_cachep,
-						GFP_KERNEL|__GFP_RECLAIMABLE);
+	    kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
 	if (!ei)
 		return NULL;
 	return &ei->vfs_inode;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/mm/slab.c linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slab.c
--- linux-2.6.21-rc7-mm2-001_deprecate/mm/slab.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slab.c	2007-04-30 16:17:34.000000000 +0100
@@ -1656,6 +1656,8 @@ static void *kmem_getpages(struct kmem_c
 #endif
 
 	flags |= cachep->gfpflags;
+	if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
+		flags |= __GFP_RECLAIMABLE;
 
 	page = alloc_pages_node(nodeid, flags, cachep->gfporder);
 	if (!page)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-001_deprecate/mm/slub.c linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slub.c
--- linux-2.6.21-rc7-mm2-001_deprecate/mm/slub.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slub.c	2007-04-30 16:17:44.000000000 +0100
@@ -762,6 +762,9 @@ static struct page *allocate_slab(struct
 	if (s->flags & SLAB_CACHE_DMA)
 		flags |= SLUB_DMA;
 
+	if (s->flags & SLAB_ACCOUNT_RECLAIM)
+		gfpflags |= __GFP_RECLAIMABLE;
+
 	if (node == -1)
 		page = alloc_pages(flags, s->order);
 	else

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 18:55 [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility Mel Gorman
                   ` (2 preceding siblings ...)
  2007-04-30 18:56 ` [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
@ 2007-04-30 18:56 ` Mel Gorman
  2007-04-30 19:08   ` Christoph Lameter
  3 siblings, 1 reply; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 18:56 UTC (permalink / raw)
  To: clameter; +Cc: Mel Gorman, linux-mm

Currently allocations that are short-lived or reclaimable by the kernel are
grouped together by specifying __GFP_RECLAIMABLE in the GFP flags. However,
it is confusing when reading code to see a temporary allocation using
__GFP_RECLAIMABLE when it is clearly not reclaimable.

This patch adds __GFP_TEMPORARY, GFP_TEMPORARY and SLAB_TEMPORARY for
temporary allocations. In reality, reclaimable and temporary allocations
are grouped into the same blocks but this might change in the future. This
change makes call sites for temporary allocations clearer. Not all temporary
allocations were previously flagged. This patch flags a few additional
allocations appropriately.

Note that some GFP_USER and GFP_KERNEL allocations are both changed to
GFP_TEMPORARY. The difference between GFP_USER and GFP_KERNEL is only in how
cpuset boundaries are handled which is unimportant to temporary allocations.

This patch can be considered as fix to
group-short-lived-and-reclaimable-kernel-allocations.patch.

Credit goes to Christoph Lameter for identifying the problems in relation to
temporary allocations during review and providing an illustration-of-concept
patch to act as a starting point.

From: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---

 drivers/block/acsi_slm.c |    2 +-
 fs/jbd/journal.c         |    8 +++-----
 fs/jbd/revoke.c          |   10 +++++-----
 fs/proc/base.c           |   12 ++++++------
 fs/proc/generic.c        |    2 +-
 fs/proc/proc_misc.c      |    2 +-
 include/linux/gfp.h      |    2 ++
 include/linux/slab.h     |    5 ++++-
 kernel/cpuset.c          |    2 +-
 mm/slub.c                |    2 +-
 net/core/skbuff.c        |    2 +-
 11 files changed, 26 insertions(+), 23 deletions(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c	2007-04-27 22:04:30.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c	2007-04-30 16:10:55.000000000 +0100
@@ -367,7 +367,7 @@ static ssize_t slm_read( struct file *fi
 	int length;
 	int end;
 
-	if (!(page = __get_free_page( GFP_KERNEL )))
+	if (!(page = __get_free_page( GFP_TEMPORARY)))
 		return( -ENOMEM );
 	
 	length = slm_getstats( (char *)page, iminor(node) );
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
@@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
 #ifdef CONFIG_JBD_DEBUG
 	atomic_inc(&nr_journal_heads);
 #endif
-	ret = kmem_cache_alloc(journal_head_cache,
-			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
+	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
 	if (ret == 0) {
 		jbd_debug(1, "out of memory for journal_head\n");
 		if (time_after(jiffies, last_warning + 5*HZ)) {
@@ -1750,8 +1749,7 @@ static struct journal_head *journal_allo
 		}
 		while (ret == 0) {
 			yield();
-			ret = kmem_cache_alloc(journal_head_cache,
-					GFP_NOFS|__GFP_RECLAIMABLE);
+			ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
 		}
 	}
 	return ret;
@@ -2017,7 +2015,7 @@ static int __init journal_init_handle_ca
 	jbd_handle_cache = kmem_cache_create("journal_handle",
 				sizeof(handle_t),
 				0,		/* offset */
-				0,		/* flags */
+				SLAB_TEMPORARY,	/* flags */
 				NULL,		/* ctor */
 				NULL);		/* dtor */
 	if (jbd_handle_cache == NULL) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/revoke.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/revoke.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/revoke.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/revoke.c	2007-04-30 16:39:43.000000000 +0100
@@ -169,7 +169,9 @@ int __init journal_init_revoke_caches(vo
 {
 	revoke_record_cache = kmem_cache_create("revoke_record",
 					   sizeof(struct jbd_revoke_record_s),
-					   0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+					   0,
+					   SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
+					   NULL, NULL);
 	if (revoke_record_cache == 0)
 		return -ENOMEM;
 
@@ -205,8 +207,7 @@ int journal_init_revoke(journal_t *journ
 	while((tmp >>= 1UL) != 0UL)
 		shift++;
 
-	journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache,
-					GFP_KERNEL|__GFP_RECLAIMABLE);
+	journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
 	if (!journal->j_revoke_table[0])
 		return -ENOMEM;
 	journal->j_revoke = journal->j_revoke_table[0];
@@ -229,8 +230,7 @@ int journal_init_revoke(journal_t *journ
 	for (tmp = 0; tmp < hash_size; tmp++)
 		INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
 
-	journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache,
-					GFP_KERNEL|__GFP_RECLAIMABLE);
+	journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
 	if (!journal->j_revoke_table[1]) {
 		kfree(journal->j_revoke_table[0]->hash_table);
 		kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]);
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/base.c linux-2.6.21-rc7-mm2-003_temporary/fs/proc/base.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/base.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/proc/base.c	2007-04-30 16:10:55.000000000 +0100
@@ -388,7 +388,7 @@ static int __mounts_open(struct inode *i
 		p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL);
 		if (p) {
 			file->private_data = &p->m;
-			p->page = (void *)__get_free_page(GFP_KERNEL);
+			p->page = (void *)__get_free_page(GFP_TEMPORARY);
 			if (p->page)
 				ret = seq_open(file, seq_ops);
 			if (!ret) {
@@ -479,7 +479,7 @@ static ssize_t proc_info_read(struct fil
 		count = PROC_BLOCK_SIZE;
 
 	length = -ENOMEM;
-	if (!(page = __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+	if (!(page = __get_free_page(GFP_TEMPORARY)))
 		goto out;
 
 	length = PROC_I(inode)->op.proc_read(task, (char*)page);
@@ -589,7 +589,7 @@ static ssize_t mem_write(struct file * f
 		goto out;
 
 	copied = -ENOMEM;
-	page = (char *)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char *)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		goto out;
 
@@ -746,7 +746,7 @@ static ssize_t proc_loginuid_write(struc
 		/* No partial writes. */
 		return -EINVAL;
 	}
-	page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char*)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		return -ENOMEM;
 	length = -EFAULT;
@@ -928,7 +928,7 @@ static int do_proc_readlink(struct dentr
 			    char __user *buffer, int buflen)
 {
 	struct inode * inode;
-	char *tmp = (char*)__get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE);
+	char *tmp = (char*)__get_free_page(GFP_TEMPORARY);
 	char *path;
 	int len;
 
@@ -1701,7 +1701,7 @@ static ssize_t proc_pid_attr_write(struc
 		goto out;
 
 	length = -ENOMEM;
-	page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char*)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		goto out;
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/generic.c linux-2.6.21-rc7-mm2-003_temporary/fs/proc/generic.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/generic.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/proc/generic.c	2007-04-30 16:10:55.000000000 +0100
@@ -74,7 +74,7 @@ proc_file_read(struct file *file, char _
 		nbytes = MAX_NON_LFS - pos;
 
 	dp = PDE(inode);
-	if (!(page = (char*) __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+	if (!(page = (char*) __get_free_page(GFP_TEMPORARY)))
 		return -ENOMEM;
 
 	while ((nbytes > 0) && !eof) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/proc_misc.c linux-2.6.21-rc7-mm2-003_temporary/fs/proc/proc_misc.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/proc/proc_misc.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/proc/proc_misc.c	2007-04-30 16:10:55.000000000 +0100
@@ -678,7 +678,7 @@ static ssize_t kpagemap_read(struct file
 	if (src & KPMMASK || count & KPMMASK)
 		return -EIO;
 
-	page = (unsigned long *)__get_free_page(GFP_USER);
+	page = (unsigned long *)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		return -ENOMEM;
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h	2007-04-30 16:10:55.000000000 +0100
@@ -50,6 +50,7 @@ struct vm_area_struct;
 #define __GFP_HARDWALL   ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
 #define __GFP_THISNODE	((__force gfp_t)0x40000u)/* No fallback, no policies */
 #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */
+#define __GFP_TEMPORARY   ((__force gfp_t)0x80000u) /* Page is short-lived */
 #define __GFP_MOVABLE	((__force gfp_t)0x100000u)  /* Page is movable */
 
 #define __GFP_BITS_SHIFT 21	/* Room for 21 __GFP_FOO bits */
@@ -72,6 +73,7 @@ struct vm_area_struct;
 #define GFP_NOIO	(__GFP_WAIT)
 #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
 #define GFP_KERNEL	(__GFP_WAIT | __GFP_IO | __GFP_FS)
+#define GFP_TEMPORARY	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_TEMPORARY)
 #define GFP_USER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
 #define GFP_HIGHUSER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
 			 __GFP_HIGHMEM)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/slab.h linux-2.6.21-rc7-mm2-003_temporary/include/linux/slab.h
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/slab.h	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/include/linux/slab.h	2007-04-30 16:10:55.000000000 +0100
@@ -26,12 +26,15 @@ typedef struct kmem_cache kmem_cache_t _
 #define SLAB_HWCACHE_ALIGN	0x00002000UL	/* Align objs on cache lines */
 #define SLAB_CACHE_DMA		0x00004000UL	/* Use GFP_DMA memory */
 #define SLAB_STORE_USER		0x00010000UL	/* DEBUG: Store the last owner for bug hunting */
-#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
 #define SLAB_PANIC		0x00040000UL	/* Panic if kmem_cache_create() fails */
 #define SLAB_DESTROY_BY_RCU	0x00080000UL	/* Defer freeing slabs to RCU */
 #define SLAB_MEM_SPREAD		0x00100000UL	/* Spread some memory over cpuset */
 #define SLAB_TRACE		0x00200000UL	/* Trace allocations and frees */
 
+/* The following flags affect grouping pages by mobility */
+#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
+#define SLAB_TEMPORARY	SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */
+
 /* Flags passed to a constructor functions */
 #define SLAB_CTOR_CONSTRUCTOR	0x001UL		/* If not set, then deconstructor */
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/kernel/cpuset.c linux-2.6.21-rc7-mm2-003_temporary/kernel/cpuset.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/kernel/cpuset.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/kernel/cpuset.c	2007-04-30 16:10:55.000000000 +0100
@@ -1361,7 +1361,7 @@ static ssize_t cpuset_common_file_read(s
 	ssize_t retval = 0;
 	char *s;
 
-	if (!(page = (char *)__get_free_page(GFP_KERNEL)))
+	if (!(page = (char *)__get_free_page(GFP_TEMPORARY)))
 		return -ENOMEM;
 
 	s = page;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slub.c linux-2.6.21-rc7-mm2-003_temporary/mm/slub.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/mm/slub.c	2007-04-30 16:17:44.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/mm/slub.c	2007-04-30 16:32:45.000000000 +0100
@@ -2691,7 +2691,7 @@ static int alloc_loc_track(struct loc_tr
 
 	order = get_order(sizeof(struct location) * max);
 
-	l = (void *)__get_free_pages(GFP_KERNEL, order);
+	l = (void *)__get_free_pages(GFP_TEMPORARY, order);
 
 	if (!l)
 		return 0;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c	2007-04-30 16:10:55.000000000 +0100
@@ -152,7 +152,7 @@ struct sk_buff *__alloc_skb(unsigned int
 	u8 *data;
 
 	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
-	gfp_mask = set_migrateflags(gfp_mask, __GFP_RECLAIMABLE);
+	gfp_mask = set_migrateflags(gfp_mask, __GFP_TEMPORARY);
 
 	/* Get the HEAD */
 	skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used
  2007-04-30 18:56 ` [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
@ 2007-04-30 19:02   ` Christoph Lameter
  0 siblings, 0 replies; 13+ messages in thread
From: Christoph Lameter @ 2007-04-30 19:02 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-mm

On Mon, 30 Apr 2007, Mel Gorman wrote:

 > A number of slab caches are reclaimable and some of their allocation
> callsites were updated to use the __GFP_RECLAIMABLE flag. However, slabs
> that are reclaimable specify the SLAB_ACCOUNT_RECLAIM flag at creation time
> and this information is available at the time of page allocation.

> This patch uses the SLAB_ACCOUNT_RECLAIM flag in the SLAB and SLUB
> allocators to determine if __GFP_RECLAIMABLE should be used when allocating
> pages. The SLOB allocator is not updated as it is unlikely to be used on
> a system where grouping pages by mobility is worthwhile. The callsites
> for reclaimable cache allocations  no longer specify __GFP_RECLAIMABLE
> as the information is redundant. This can be considered as fix to
> group-short-lived-and-reclaimable-kernel-allocations.patch.

Acked-by: Christoph Lameter <clameter@sgi.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 18:56 ` [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
@ 2007-04-30 19:08   ` Christoph Lameter
  2007-04-30 19:44     ` Mel Gorman
  0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2007-04-30 19:08 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-mm

On Mon, 30 Apr 2007, Mel Gorman wrote:

> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c
> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c	2007-04-27 22:04:30.000000000 +0100
> +++ linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c	2007-04-30 16:10:55.000000000 +0100
> @@ -367,7 +367,7 @@ static ssize_t slm_read( struct file *fi
>  	int length;
>  	int end;
>  
> -	if (!(page = __get_free_page( GFP_KERNEL )))
> +	if (!(page = __get_free_page( GFP_TEMPORARY)))

White space damage.

>  		return( -ENOMEM );
>  	
>  	length = slm_getstats( (char *)page, iminor(node) );
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c
> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
> +++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
> @@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
>  #ifdef CONFIG_JBD_DEBUG
>  	atomic_inc(&nr_journal_heads);
>  #endif
> -	ret = kmem_cache_alloc(journal_head_cache,
> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
>  	if (ret == 0) {

This chunk belongs into the earlier patch.

> @@ -1750,8 +1749,7 @@ static struct journal_head *journal_allo
>  		}
>  		while (ret == 0) {
>  			yield();
> -			ret = kmem_cache_alloc(journal_head_cache,
> -					GFP_NOFS|__GFP_RECLAIMABLE);
> +			ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
>  		}
>  	}

Ditto

> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h
> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h	2007-04-27 22:04:33.000000000 +0100
> +++ linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h	2007-04-30 16:10:55.000000000 +0100
> @@ -50,6 +50,7 @@ struct vm_area_struct;
>  #define __GFP_HARDWALL   ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
>  #define __GFP_THISNODE	((__force gfp_t)0x40000u)/* No fallback, no policies */
>  #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */
> +#define __GFP_TEMPORARY   ((__force gfp_t)0x80000u) /* Page is short-lived */
>  #define __GFP_MOVABLE	((__force gfp_t)0x100000u)  /* Page is movable */

Aliases a __GFP flag. We do not do that. Is there really a need to use 
__GFP_TEMPORARY outside of the allocators? Just use __GFP_RECLAIMALBE?

> @@ -72,6 +73,7 @@ struct vm_area_struct;
>  #define GFP_NOIO	(__GFP_WAIT)
>  #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
>  #define GFP_KERNEL	(__GFP_WAIT | __GFP_IO | __GFP_FS)
> +#define GFP_TEMPORARY	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_TEMPORARY)

s/__GFP_TEMPORARY/__GFP_RECLAIMABLE/ ?

> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c
> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c	2007-04-27 22:04:34.000000000 +0100
> +++ linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c	2007-04-30 16:10:55.000000000 +0100
> @@ -152,7 +152,7 @@ struct sk_buff *__alloc_skb(unsigned int
>  	u8 *data;
>  
>  	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
> -	gfp_mask = set_migrateflags(gfp_mask, __GFP_RECLAIMABLE);
> +	gfp_mask = set_migrateflags(gfp_mask, __GFP_TEMPORARY);
>  
>  	/* Get the HEAD */
>  	skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);

Why is the gfp_mask set to __GFP_TEMPORARY here? The slab parameters are 
set during slab creation. 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 19:08   ` Christoph Lameter
@ 2007-04-30 19:44     ` Mel Gorman
  2007-04-30 19:52       ` Christoph Lameter
  0 siblings, 1 reply; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 19:44 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm

> On Mon, 30 Apr 2007, Mel Gorman wrote:
>
>> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c
>> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/drivers/block/acsi_slm.c	2007-04-27 22:04:30.000000000 +0100
>> +++ linux-2.6.21-rc7-mm2-003_temporary/drivers/block/acsi_slm.c	2007-04-30 16:10:55.000000000 +0100
>> @@ -367,7 +367,7 @@ static ssize_t slm_read( struct file *fi
>>  	int length;
>>  	int end;
>>
>> -	if (!(page = __get_free_page( GFP_KERNEL )))
>> +	if (!(page = __get_free_page( GFP_TEMPORARY)))
>
> White space damage.
>

Fixed. to be ( GFP_TEMPORARY ) although that itself looks odd.

>>  		return( -ENOMEM );
>>
>>  	length = slm_getstats( (char *)page, iminor(node) );
>> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c
>> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
>> +++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
>> @@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
>>  #ifdef CONFIG_JBD_DEBUG
>>  	atomic_inc(&nr_journal_heads);
>>  #endif
>> -	ret = kmem_cache_alloc(journal_head_cache,
>> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
>> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
>>  	if (ret == 0) {
>
> This chunk belongs into the earlier patch.
>

Why? kmem_cache_create() is changed here in this patch to use SLAB_TEMPORARY 
which is not defined until this patch.

>> @@ -1750,8 +1749,7 @@ static struct journal_head *journal_allo
>>  		}
>>  		while (ret == 0) {
>>  			yield();
>> -			ret = kmem_cache_alloc(journal_head_cache,
>> -					GFP_NOFS|__GFP_RECLAIMABLE);
>> +			ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
>>  		}
>>  	}
>
> Ditto
>

And same. 

>> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h
>> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/gfp.h	2007-04-27 22:04:33.000000000 +0100
>> +++ linux-2.6.21-rc7-mm2-003_temporary/include/linux/gfp.h	2007-04-30 16:10:55.000000000 +0100
>> @@ -50,6 +50,7 @@ struct vm_area_struct;
>>  #define __GFP_HARDWALL   ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
>>  #define __GFP_THISNODE	((__force gfp_t)0x40000u)/* No fallback, no policies */
>>  #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */
>> +#define __GFP_TEMPORARY   ((__force gfp_t)0x80000u) /* Page is short-lived */
>>  #define __GFP_MOVABLE	((__force gfp_t)0x100000u)  /* Page is movable */
>
> Aliases a __GFP flag. We do not do that. Is there really a need to use
> __GFP_TEMPORARY outside of the allocators? Just use __GFP_RECLAIMALBE?
>

I could. It was defined this way because a later TODO item was to group 
__GFP_TEMPORARY allocations separately.

>> @@ -72,6 +73,7 @@ struct vm_area_struct;
>>  #define GFP_NOIO	(__GFP_WAIT)
>>  #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
>>  #define GFP_KERNEL	(__GFP_WAIT | __GFP_IO | __GFP_FS)
>> +#define GFP_TEMPORARY	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_TEMPORARY)
>
> s/__GFP_TEMPORARY/__GFP_RECLAIMABLE/ ?
>

It can be done that way and define __GFP_TEMPORARY later when it means
something.

>> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c
>> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/net/core/skbuff.c	2007-04-27 22:04:34.000000000 +0100
>> +++ linux-2.6.21-rc7-mm2-003_temporary/net/core/skbuff.c	2007-04-30 16:10:55.000000000 +0100
>> @@ -152,7 +152,7 @@ struct sk_buff *__alloc_skb(unsigned int
>>  	u8 *data;
>>
>>  	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
>> -	gfp_mask = set_migrateflags(gfp_mask, __GFP_RECLAIMABLE);
>> +	gfp_mask = set_migrateflags(gfp_mask, __GFP_TEMPORARY);
>>
>>  	/* Get the HEAD */
>>  	skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);
>
> Why is the gfp_mask set to __GFP_TEMPORARY here? The slab parameters are
> set during slab creation.
>

Makes more sense. Revised patch as follows;

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/drivers/block/acsi_slm.c linux-2.6.21-rc7-mm2-004_temporary/drivers/block/acsi_slm.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/drivers/block/acsi_slm.c	2007-04-27 22:04:30.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/drivers/block/acsi_slm.c	2007-04-30 20:38:38.000000000 +0100
@@ -367,7 +367,7 @@ static ssize_t slm_read( struct file *fi
 	int length;
 	int end;
 
-	if (!(page = __get_free_page( GFP_KERNEL )))
+	if (!(page = __get_free_page( GFP_TEMPORARY )))
 		return( -ENOMEM );
 	
 	length = slm_getstats( (char *)page, iminor(node) );
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/jbd/journal.c linux-2.6.21-rc7-mm2-004_temporary/fs/jbd/journal.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/fs/jbd/journal.c	2007-04-30 20:38:38.000000000 +0100
@@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
 #ifdef CONFIG_JBD_DEBUG
 	atomic_inc(&nr_journal_heads);
 #endif
-	ret = kmem_cache_alloc(journal_head_cache,
-			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
+	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
 	if (ret == 0) {
 		jbd_debug(1, "out of memory for journal_head\n");
 		if (time_after(jiffies, last_warning + 5*HZ)) {
@@ -1750,8 +1749,7 @@ static struct journal_head *journal_allo
 		}
 		while (ret == 0) {
 			yield();
-			ret = kmem_cache_alloc(journal_head_cache,
-					GFP_NOFS|__GFP_RECLAIMABLE);
+			ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
 		}
 	}
 	return ret;
@@ -2017,7 +2015,7 @@ static int __init journal_init_handle_ca
 	jbd_handle_cache = kmem_cache_create("journal_handle",
 				sizeof(handle_t),
 				0,		/* offset */
-				0,		/* flags */
+				SLAB_TEMPORARY,	/* flags */
 				NULL,		/* ctor */
 				NULL);		/* dtor */
 	if (jbd_handle_cache == NULL) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/jbd/revoke.c linux-2.6.21-rc7-mm2-004_temporary/fs/jbd/revoke.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/jbd/revoke.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/fs/jbd/revoke.c	2007-04-30 20:38:38.000000000 +0100
@@ -169,7 +169,9 @@ int __init journal_init_revoke_caches(vo
 {
 	revoke_record_cache = kmem_cache_create("revoke_record",
 					   sizeof(struct jbd_revoke_record_s),
-					   0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+					   0,
+					   SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
+					   NULL, NULL);
 	if (revoke_record_cache == 0)
 		return -ENOMEM;
 
@@ -205,8 +207,7 @@ int journal_init_revoke(journal_t *journ
 	while((tmp >>= 1UL) != 0UL)
 		shift++;
 
-	journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache,
-					GFP_KERNEL|__GFP_RECLAIMABLE);
+	journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
 	if (!journal->j_revoke_table[0])
 		return -ENOMEM;
 	journal->j_revoke = journal->j_revoke_table[0];
@@ -229,8 +230,7 @@ int journal_init_revoke(journal_t *journ
 	for (tmp = 0; tmp < hash_size; tmp++)
 		INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
 
-	journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache,
-					GFP_KERNEL|__GFP_RECLAIMABLE);
+	journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
 	if (!journal->j_revoke_table[1]) {
 		kfree(journal->j_revoke_table[0]->hash_table);
 		kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]);
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/base.c linux-2.6.21-rc7-mm2-004_temporary/fs/proc/base.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/base.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/fs/proc/base.c	2007-04-30 20:38:38.000000000 +0100
@@ -388,7 +388,7 @@ static int __mounts_open(struct inode *i
 		p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL);
 		if (p) {
 			file->private_data = &p->m;
-			p->page = (void *)__get_free_page(GFP_KERNEL);
+			p->page = (void *)__get_free_page(GFP_TEMPORARY);
 			if (p->page)
 				ret = seq_open(file, seq_ops);
 			if (!ret) {
@@ -479,7 +479,7 @@ static ssize_t proc_info_read(struct fil
 		count = PROC_BLOCK_SIZE;
 
 	length = -ENOMEM;
-	if (!(page = __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+	if (!(page = __get_free_page(GFP_TEMPORARY)))
 		goto out;
 
 	length = PROC_I(inode)->op.proc_read(task, (char*)page);
@@ -589,7 +589,7 @@ static ssize_t mem_write(struct file * f
 		goto out;
 
 	copied = -ENOMEM;
-	page = (char *)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char *)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		goto out;
 
@@ -746,7 +746,7 @@ static ssize_t proc_loginuid_write(struc
 		/* No partial writes. */
 		return -EINVAL;
 	}
-	page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char*)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		return -ENOMEM;
 	length = -EFAULT;
@@ -928,7 +928,7 @@ static int do_proc_readlink(struct dentr
 			    char __user *buffer, int buflen)
 {
 	struct inode * inode;
-	char *tmp = (char*)__get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE);
+	char *tmp = (char*)__get_free_page(GFP_TEMPORARY);
 	char *path;
 	int len;
 
@@ -1701,7 +1701,7 @@ static ssize_t proc_pid_attr_write(struc
 		goto out;
 
 	length = -ENOMEM;
-	page = (char*)__get_free_page(GFP_USER|__GFP_RECLAIMABLE);
+	page = (char*)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		goto out;
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/generic.c linux-2.6.21-rc7-mm2-004_temporary/fs/proc/generic.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/generic.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/fs/proc/generic.c	2007-04-30 20:38:38.000000000 +0100
@@ -74,7 +74,7 @@ proc_file_read(struct file *file, char _
 		nbytes = MAX_NON_LFS - pos;
 
 	dp = PDE(inode);
-	if (!(page = (char*) __get_free_page(GFP_KERNEL|__GFP_RECLAIMABLE)))
+	if (!(page = (char*) __get_free_page(GFP_TEMPORARY)))
 		return -ENOMEM;
 
 	while ((nbytes > 0) && !eof) {
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/proc_misc.c linux-2.6.21-rc7-mm2-004_temporary/fs/proc/proc_misc.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/fs/proc/proc_misc.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/fs/proc/proc_misc.c	2007-04-30 20:38:38.000000000 +0100
@@ -678,7 +678,7 @@ static ssize_t kpagemap_read(struct file
 	if (src & KPMMASK || count & KPMMASK)
 		return -EIO;
 
-	page = (unsigned long *)__get_free_page(GFP_USER);
+	page = (unsigned long *)__get_free_page(GFP_TEMPORARY);
 	if (!page)
 		return -ENOMEM;
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/include/linux/gfp.h linux-2.6.21-rc7-mm2-004_temporary/include/linux/gfp.h
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/include/linux/gfp.h	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/include/linux/gfp.h	2007-04-30 20:38:38.000000000 +0100
@@ -72,6 +72,7 @@ struct vm_area_struct;
 #define GFP_NOIO	(__GFP_WAIT)
 #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
 #define GFP_KERNEL	(__GFP_WAIT | __GFP_IO | __GFP_FS)
+#define GFP_TEMPORARY	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_RECLAIMABLE)
 #define GFP_USER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
 #define GFP_HIGHUSER	(__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
 			 __GFP_HIGHMEM)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/include/linux/slab.h linux-2.6.21-rc7-mm2-004_temporary/include/linux/slab.h
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/include/linux/slab.h	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/include/linux/slab.h	2007-04-30 20:38:38.000000000 +0100
@@ -26,12 +26,15 @@ typedef struct kmem_cache kmem_cache_t _
 #define SLAB_HWCACHE_ALIGN	0x00002000UL	/* Align objs on cache lines */
 #define SLAB_CACHE_DMA		0x00004000UL	/* Use GFP_DMA memory */
 #define SLAB_STORE_USER		0x00010000UL	/* DEBUG: Store the last owner for bug hunting */
-#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
 #define SLAB_PANIC		0x00040000UL	/* Panic if kmem_cache_create() fails */
 #define SLAB_DESTROY_BY_RCU	0x00080000UL	/* Defer freeing slabs to RCU */
 #define SLAB_MEM_SPREAD		0x00100000UL	/* Spread some memory over cpuset */
 #define SLAB_TRACE		0x00200000UL	/* Trace allocations and frees */
 
+/* The following flags affect grouping pages by mobility */
+#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
+#define SLAB_TEMPORARY	SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */
+
 /* Flags passed to a constructor functions */
 #define SLAB_CTOR_CONSTRUCTOR	0x001UL		/* If not set, then deconstructor */
 
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/kernel/cpuset.c linux-2.6.21-rc7-mm2-004_temporary/kernel/cpuset.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/kernel/cpuset.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/kernel/cpuset.c	2007-04-30 20:38:38.000000000 +0100
@@ -1361,7 +1361,7 @@ static ssize_t cpuset_common_file_read(s
 	ssize_t retval = 0;
 	char *s;
 
-	if (!(page = (char *)__get_free_page(GFP_KERNEL)))
+	if (!(page = (char *)__get_free_page(GFP_TEMPORARY)))
 		return -ENOMEM;
 
 	s = page;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/mm/slub.c linux-2.6.21-rc7-mm2-004_temporary/mm/slub.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/mm/slub.c	2007-04-30 20:36:22.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/mm/slub.c	2007-04-30 20:38:38.000000000 +0100
@@ -2691,7 +2691,7 @@ static int alloc_loc_track(struct loc_tr
 
 	order = get_order(sizeof(struct location) * max);
 
-	l = (void *)__get_free_pages(GFP_KERNEL, order);
+	l = (void *)__get_free_pages(GFP_TEMPORARY, order);
 
 	if (!l)
 		return 0;
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-003_account_reclaimable/net/core/skbuff.c linux-2.6.21-rc7-mm2-004_temporary/net/core/skbuff.c
--- linux-2.6.21-rc7-mm2-003_account_reclaimable/net/core/skbuff.c	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-004_temporary/net/core/skbuff.c	2007-04-30 20:40:06.000000000 +0100
@@ -152,7 +152,6 @@ struct sk_buff *__alloc_skb(unsigned int
 	u8 *data;
 
 	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
-	gfp_mask = set_migrateflags(gfp_mask, __GFP_RECLAIMABLE);
 
 	/* Get the HEAD */
 	skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node);
@@ -2002,16 +2001,16 @@ EXPORT_SYMBOL_GPL(skb_segment);
 void __init skb_init(void)
 {
 	skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
-					      sizeof(struct sk_buff),
-					      0,
-					      SLAB_HWCACHE_ALIGN|SLAB_PANIC,
-					      NULL, NULL);
+				sizeof(struct sk_buff),
+				0,
+				SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_TEMPORARY,
+				NULL, NULL);
 	skbuff_fclone_cache = kmem_cache_create("skbuff_fclone_cache",
-						(2*sizeof(struct sk_buff)) +
-						sizeof(atomic_t),
-						0,
-						SLAB_HWCACHE_ALIGN|SLAB_PANIC,
-						NULL, NULL);
+				(2*sizeof(struct sk_buff)) +
+				sizeof(atomic_t),
+				0,
+				SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_TEMPORARY,
+				NULL, NULL);
 }
 
 /**
-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 19:44     ` Mel Gorman
@ 2007-04-30 19:52       ` Christoph Lameter
  2007-04-30 20:11         ` Mel Gorman
  0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2007-04-30 19:52 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-mm

On Mon, 30 Apr 2007, Mel Gorman wrote:

> > White space damage.
> >
> 
> Fixed. to be ( GFP_TEMPORARY ) although that itself looks odd.

Needs to be (GFP_TEMPORARY)

> >> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
> >> +++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
> >> @@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
> >>  #ifdef CONFIG_JBD_DEBUG
> >>  	atomic_inc(&nr_journal_heads);
> >>  #endif
> >> -	ret = kmem_cache_alloc(journal_head_cache,
> >> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
> >> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
> >>  	if (ret == 0) {
> >
> > This chunk belongs into the earlier patch.
> >
> 
> Why? kmem_cache_create() is changed here in this patch to use SLAB_TEMPORARY 
> which is not defined until this patch.

I do not see a SLAB_TEMPORARY here.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 19:52       ` Christoph Lameter
@ 2007-04-30 20:11         ` Mel Gorman
  2007-04-30 20:14           ` Christoph Lameter
  0 siblings, 1 reply; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 20:11 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm

On (30/04/07 12:52), Christoph Lameter didst pronounce:
> On Mon, 30 Apr 2007, Mel Gorman wrote:
> 
> > > White space damage.
> > >
> > 
> > Fixed. to be ( GFP_TEMPORARY ) although that itself looks odd.
> 
> Needs to be (GFP_TEMPORARY)
> 

agreed. Fixed

> > >> --- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
> > >> +++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
> > >> @@ -1739,8 +1739,7 @@ static struct journal_head *journal_allo
> > >>  #ifdef CONFIG_JBD_DEBUG
> > >>  	atomic_inc(&nr_journal_heads);
> > >>  #endif
> > >> -	ret = kmem_cache_alloc(journal_head_cache,
> > >> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
> > >> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
> > >>  	if (ret == 0) {
> > >
> > > This chunk belongs into the earlier patch.
> > >
> > 
> > Why? kmem_cache_create() is changed here in this patch to use SLAB_TEMPORARY 
> > which is not defined until this patch.
> 
> I do not see a SLAB_TEMPORARY here.

Here are the relevant portions of the fourth patch.

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/slab.h linux-2.6.21-rc7-mm2-003_temporary/include/linux/slab.h
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/include/linux/slab.h	2007-04-27 22:04:34.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/include/linux/slab.h	2007-04-30 16:10:55.000000000 +0100
@@ -26,12 +26,15 @@ typedef struct kmem_cache kmem_cache_t _
 #define SLAB_HWCACHE_ALIGN	0x00002000UL	/* Align objs on cache lines */
 #define SLAB_CACHE_DMA		0x00004000UL	/* Use GFP_DMA memory */
 #define SLAB_STORE_USER		0x00010000UL	/* DEBUG: Store the last owner for bug hunting */
-#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
 #define SLAB_PANIC		0x00040000UL	/* Panic if kmem_cache_create() fails */
 #define SLAB_DESTROY_BY_RCU	0x00080000UL	/* Defer freeing slabs to RCU */
 #define SLAB_MEM_SPREAD		0x00100000UL	/* Spread some memory over cpuset */
 #define SLAB_TRACE		0x00200000UL	/* Trace allocations and frees */
 
+/* The following flags affect grouping pages by mobility */
+#define SLAB_RECLAIM_ACCOUNT	0x00020000UL	/* Objects are reclaimable */
+#define SLAB_TEMPORARY	SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */
+
 /* Flags passed to a constructor functions */
 #define SLAB_CTOR_CONSTRUCTOR	0x001UL		/* If not set, then deconstructor */

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/journal.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/journal.c	2007-04-30 16:38:41.000000000 +0100
@@ -2017,7 +2015,7 @@ static int __init journal_init_handle_ca
 	jbd_handle_cache = kmem_cache_create("journal_handle",
 				sizeof(handle_t),
 				0,		/* offset */
-				0,		/* flags */
+				SLAB_TEMPORARY,	/* flags */
 				NULL,		/* ctor */
 				NULL);		/* dtor */
 	if (jbd_handle_cache == NULL) {

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/revoke.c linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/revoke.c
--- linux-2.6.21-rc7-mm2-002_account_reclaimable/fs/jbd/revoke.c	2007-04-27 22:04:33.000000000 +0100
+++ linux-2.6.21-rc7-mm2-003_temporary/fs/jbd/revoke.c	2007-04-30 16:39:43.000000000 +0100
@@ -169,7 +169,9 @@ int __init journal_init_revoke_caches(vo
 {
 	revoke_record_cache = kmem_cache_create("revoke_record",
 					   sizeof(struct jbd_revoke_record_s),
-					   0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+					   0,
+					   SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
+					   NULL, NULL);
 	if (revoke_record_cache == 0)
 		return -ENOMEM;
 
-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 20:11         ` Mel Gorman
@ 2007-04-30 20:14           ` Christoph Lameter
  2007-04-30 20:33             ` Mel Gorman
  0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2007-04-30 20:14 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-mm

On Mon, 30 Apr 2007, Mel Gorman wrote:

> > > >>  #ifdef CONFIG_JBD_DEBUG
> > > >>  	atomic_inc(&nr_journal_heads);
> > > >>  #endif
> > > >> -	ret = kmem_cache_alloc(journal_head_cache,
> > > >> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
> > > >> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
> > > >>  	if (ret == 0) {
> > > >
> > > > This chunk belongs into the earlier patch.
> > > >
> > > 
> > > Why? kmem_cache_create() is changed here in this patch to use SLAB_TEMPORARY 
> > > which is not defined until this patch.
> > 
> > I do not see a SLAB_TEMPORARY here.
> 
> Here are the relevant portions of the fourth patch.

Ahh. Ok.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived
  2007-04-30 20:14           ` Christoph Lameter
@ 2007-04-30 20:33             ` Mel Gorman
  0 siblings, 0 replies; 13+ messages in thread
From: Mel Gorman @ 2007-04-30 20:33 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Linux Memory Management List

On Mon, 30 Apr 2007, Christoph Lameter wrote:

> On Mon, 30 Apr 2007, Mel Gorman wrote:
>
>>>>>>  #ifdef CONFIG_JBD_DEBUG
>>>>>>  	atomic_inc(&nr_journal_heads);
>>>>>>  #endif
>>>>>> -	ret = kmem_cache_alloc(journal_head_cache,
>>>>>> -			set_migrateflags(GFP_NOFS, __GFP_RECLAIMABLE));
>>>>>> +	ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
>>>>>>  	if (ret == 0) {
>>>>>
>>>>> This chunk belongs into the earlier patch.
>>>>>
>>>>
>>>> Why? kmem_cache_create() is changed here in this patch to use SLAB_TEMPORARY
>>>> which is not defined until this patch.
>>>
>>> I do not see a SLAB_TEMPORARY here.
>>
>> Here are the relevant portions of the fourth patch.
>
> Ahh. Ok.
>

I'll assume that means they are currently located in the right patch. I've 
queued up more tests with the revised patchset. Assuming they pass, I'll 
push them towards Andrew and start on the 
grouping-at-orders-other-than-MAX_ORDER patch.

Thanks.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/4] Remove alloc_zeroed_user_highpage()
  2007-05-09  8:27 [PATCH 0/4] Minor updates and fixes to grouping pages by mobility Mel Gorman
@ 2007-05-09  8:28 ` Mel Gorman
  0 siblings, 0 replies; 13+ messages in thread
From: Mel Gorman @ 2007-05-09  8:28 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, apw, clameter, Mel Gorman

alloc_zeroed_user_highpage() has no in-tree users and it is not exported.
As it is not exported, it can simply be removed.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---

 highmem.h |   15 ---------------
 1 file changed, 15 deletions(-)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-mm1-002_allocflagsorder/include/linux/highmem.h linux-2.6.21-mm1-003_deprecate/include/linux/highmem.h
--- linux-2.6.21-mm1-002_allocflagsorder/include/linux/highmem.h	2007-05-08 09:24:39.000000000 +0100
+++ linux-2.6.21-mm1-003_deprecate/include/linux/highmem.h	2007-05-08 09:31:48.000000000 +0100
@@ -98,21 +98,6 @@ __alloc_zeroed_user_highpage(gfp_t movab
 #endif
 
 /**
- * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA
- * @vma: The VMA the page is to be allocated for
- * @vaddr: The virtual address the page will be inserted into
- *
- * This function will allocate a page for a VMA that the caller knows will
- * not be able to move in the future using move_pages() or reclaim. If it
- * is known that the page can move, use alloc_zeroed_user_highpage_movable
- */
-static inline struct page *
-alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
-{
-	return __alloc_zeroed_user_highpage(0, vma, vaddr);
-}
-
-/**
  * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
  * @vma: The VMA the page is to be allocated for
  * @vaddr: The virtual address the page will be inserted into

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-05-09  8:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-30 18:55 [PATCH 0/4] Clarify GFP flag usage when grouping pages by mobility Mel Gorman
2007-04-30 18:55 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage on m68knommu Mel Gorman
2007-04-30 18:56 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
2007-04-30 18:56 ` [PATCH 3/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
2007-04-30 19:02   ` Christoph Lameter
2007-04-30 18:56 ` [PATCH 4/4] Add __GFP_TEMPORARY to identify allocations that are short-lived Mel Gorman
2007-04-30 19:08   ` Christoph Lameter
2007-04-30 19:44     ` Mel Gorman
2007-04-30 19:52       ` Christoph Lameter
2007-04-30 20:11         ` Mel Gorman
2007-04-30 20:14           ` Christoph Lameter
2007-04-30 20:33             ` Mel Gorman
2007-05-09  8:27 [PATCH 0/4] Minor updates and fixes to grouping pages by mobility Mel Gorman
2007-05-09  8:28 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox