* [PATCH 0/4] Minor updates and fixes to grouping pages by mobility
@ 2007-05-09 8:27 Mel Gorman
2007-05-09 8:28 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage() on m68knommu Mel Gorman
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Mel Gorman @ 2007-05-09 8:27 UTC (permalink / raw)
To: akpm; +Cc: Mel Gorman, clameter, apw, linux-mm
Hi Andrew,
The following patches are some fixes put together as a result of review
feedback from Christoph Lameter. Other patches based on his review are still
being developed but I am sending these now so I can free time to look closer
at the latest SLUB patches.
The first patch fixes a problem on m68knommu where
the helper for alloc_zeroed_user_highpage_movable() was not defined properly.
This patch should be considered a fix for
add-__gfp_movable-for-callers-to-flag-allocations-from-high-memory-that-may-be-migrated.patch
The second patch removes alloc_zeroed_user_highpage which has no
in-tree users and is not exported. It can also be considered a fix for
add-__gfp_movable-for-callers-to-flag-allocations-from-high-memory-that-may-be-migrated.patch
The third patch removes a parameter from allocflags_to_migratetype()
that is no longer used. It is a fix for the patch
dont-group-high-order-atomic-allocations.patch.
The fourth patch uses the fact that slab marks reclaimable caches
SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used.
--
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] 6+ messages in thread
* [PATCH 1/4] Fix alloc_zeroed_user_highpage() on m68knommu
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
2007-05-09 8:28 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2007-05-09 8:28 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, Mel Gorman, apw, clameter
The patch
add-__gfp_movable-for-callers-to-flag-allocations-from-high-memory-that-may-be-migrated.patch
missed updating the m68knommu architecture when 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 file changed, 2 insertions(+), 1 deletion(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-mm1-clean/include/asm-m68knommu/page.h linux-2.6.21-mm1-001_m68knommu/include/asm-m68knommu/page.h
--- linux-2.6.21-mm1-clean/include/asm-m68knommu/page.h 2007-04-26 04:08:32.000000000 +0100
+++ linux-2.6.21-mm1-001_m68knommu/include/asm-m68knommu/page.h 2007-05-08 09:27: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] 6+ 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 ` [PATCH 1/4] Fix alloc_zeroed_user_highpage() on m68knommu Mel Gorman
@ 2007-05-09 8:28 ` Mel Gorman
2007-05-09 8:28 ` [PATCH 3/4] Remove unused parameter to allocflags_to_migratetype() Mel Gorman
2007-05-09 8:29 ` [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
3 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [PATCH 3/4] Remove unused parameter to allocflags_to_migratetype()
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 1/4] Fix alloc_zeroed_user_highpage() on m68knommu Mel Gorman
2007-05-09 8:28 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
@ 2007-05-09 8:28 ` Mel Gorman
2007-05-09 8:29 ` [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
3 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2007-05-09 8:28 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, clameter, Mel Gorman, apw
The patch dont-group-high-order-atomic-allocations.patch should have removed
the order parameter to allocflags_to_migratetype() but did not. This patch
addresses the problem.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---
page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.21-mm1-001_m68knommu/mm/page_alloc.c linux-2.6.21-mm1-002_allocflagsorder/mm/page_alloc.c
--- linux-2.6.21-mm1-001_m68knommu/mm/page_alloc.c 2007-05-08 09:24:40.000000000 +0100
+++ linux-2.6.21-mm1-002_allocflagsorder/mm/page_alloc.c 2007-05-08 09:29:42.000000000 +0100
@@ -160,7 +160,7 @@ static void set_pageblock_migratetype(st
PB_migrate, PB_migrate_end);
}
-static inline int allocflags_to_migratetype(gfp_t gfp_flags, int order)
+static inline int allocflags_to_migratetype(gfp_t gfp_flags)
{
WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK);
@@ -1138,7 +1138,7 @@ static struct page *buffered_rmqueue(str
struct page *page;
int cold = !!(gfp_flags & __GFP_COLD);
int cpu;
- int migratetype = allocflags_to_migratetype(gfp_flags, order);
+ int migratetype = allocflags_to_migratetype(gfp_flags);
again:
cpu = get_cpu();
--
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] 6+ messages in thread
* [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used
2007-05-09 8:27 [PATCH 0/4] Minor updates and fixes to grouping pages by mobility Mel Gorman
` (2 preceding siblings ...)
2007-05-09 8:28 ` [PATCH 3/4] Remove unused parameter to allocflags_to_migratetype() Mel Gorman
@ 2007-05-09 8:29 ` Mel Gorman
2007-05-09 19:21 ` Christoph Lameter
3 siblings, 1 reply; 6+ messages in thread
From: Mel Gorman @ 2007-05-09 8:29 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, Mel Gorman, apw, clameter
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 and
now SLUB is recommended over SLOB for smaller systems. 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>
Acked-by: Christoph Lameter <clameter@sgi.com>
---
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-mm1-003_deprecate/fs/dcache.c linux-2.6.21-mm1-004_account_reclaimable/fs/dcache.c
--- linux-2.6.21-mm1-003_deprecate/fs/dcache.c 2007-05-08 09:24:38.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/fs/dcache.c 2007-05-08 09:33:49.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-mm1-003_deprecate/fs/ext2/super.c linux-2.6.21-mm1-004_account_reclaimable/fs/ext2/super.c
--- linux-2.6.21-mm1-003_deprecate/fs/ext2/super.c 2007-05-08 09:24:38.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/fs/ext2/super.c 2007-05-08 09:33:49.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-mm1-003_deprecate/fs/ext3/super.c linux-2.6.21-mm1-004_account_reclaimable/fs/ext3/super.c
--- linux-2.6.21-mm1-003_deprecate/fs/ext3/super.c 2007-05-08 09:24:38.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/fs/ext3/super.c 2007-05-08 09:33:49.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-mm1-003_deprecate/fs/ntfs/inode.c linux-2.6.21-mm1-004_account_reclaimable/fs/ntfs/inode.c
--- linux-2.6.21-mm1-003_deprecate/fs/ntfs/inode.c 2007-05-08 09:24:39.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/fs/ntfs/inode.c 2007-05-08 09:33:49.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-mm1-003_deprecate/fs/reiserfs/super.c linux-2.6.21-mm1-004_account_reclaimable/fs/reiserfs/super.c
--- linux-2.6.21-mm1-003_deprecate/fs/reiserfs/super.c 2007-05-08 09:24:39.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/fs/reiserfs/super.c 2007-05-08 09:33:49.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-mm1-003_deprecate/mm/slab.c linux-2.6.21-mm1-004_account_reclaimable/mm/slab.c
--- linux-2.6.21-mm1-003_deprecate/mm/slab.c 2007-05-08 09:24:40.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/mm/slab.c 2007-05-08 09:33:49.000000000 +0100
@@ -1660,6 +1660,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-mm1-003_deprecate/mm/slub.c linux-2.6.21-mm1-004_account_reclaimable/mm/slub.c
--- linux-2.6.21-mm1-003_deprecate/mm/slub.c 2007-05-08 09:24:40.000000000 +0100
+++ linux-2.6.21-mm1-004_account_reclaimable/mm/slub.c 2007-05-08 09:33:49.000000000 +0100
@@ -785,6 +785,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] 6+ messages in thread
* Re: [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used
2007-05-09 8:29 ` [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
@ 2007-05-09 19:21 ` Christoph Lameter
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2007-05-09 19:21 UTC (permalink / raw)
To: Mel Gorman; +Cc: akpm, linux-mm, apw
On Wed, 9 May 2007, Mel Gorman wrote:
> Credit goes to Christoph Lameter for identifying this problem during review
> and suggesting this fix.
It was not a problem. It is just much simpler to use the existing
information. Does not affect the correctness of what you are doing.
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] 6+ messages in thread
end of thread, other threads:[~2007-05-09 19:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 1/4] Fix alloc_zeroed_user_highpage() on m68knommu Mel Gorman
2007-05-09 8:28 ` [PATCH 2/4] Remove alloc_zeroed_user_highpage() Mel Gorman
2007-05-09 8:28 ` [PATCH 3/4] Remove unused parameter to allocflags_to_migratetype() Mel Gorman
2007-05-09 8:29 ` [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Mel Gorman
2007-05-09 19:21 ` Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox