From: Mel Gorman <mel@csn.ul.ie>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Mel Gorman <mel@csn.ul.ie>,
apw@shadowen.org, clameter@sgi.com
Subject: [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used
Date: Wed, 9 May 2007 09:29:08 +0100 (IST) [thread overview]
Message-ID: <20070509082908.19219.63588.sendpatchset@skynet.skynet.ie> (raw)
In-Reply-To: <20070509082748.19219.48015.sendpatchset@skynet.skynet.ie>
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>
next prev parent reply other threads:[~2007-05-09 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Mel Gorman [this message]
2007-05-09 19:21 ` [PATCH 4/4] Use SLAB_ACCOUNT_RECLAIM to determine when __GFP_RECLAIMABLE should be used Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070509082908.19219.63588.sendpatchset@skynet.skynet.ie \
--to=mel@csn.ul.ie \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox