From: Namjae Jeon <linkinjeon@gmail.com>
To: tytso@mit.edu
Cc: linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
Namjae Jeon <linkinjeon@gmail.com>,
Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: [PATCH] ext4: slab caches set to SLAB_MEM_SPREAD flags.
Date: Thu, 17 Nov 2011 00:04:08 +0900 [thread overview]
Message-ID: <1321455848-1929-1-git-send-email-linkinjeon@gmail.com> (raw)
If slab caches set to SLAB_MEM_SPREAD flags, The allocation is spread evenly over all the memory nodes instead of favoring allocation on the node local to current cpu.
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
---
fs/ext4/mballoc.c | 9 +++++----
fs/ext4/page-io.c | 6 ++++--
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e2d8be8..86efde7 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2407,7 +2407,8 @@ static int ext4_groupinfo_create_slab(size_t size)
bb_counters[blocksize_bits + 2]);
cachep = kmem_cache_create(ext4_groupinfo_slab_names[cache_index],
- slab_size, 0, SLAB_RECLAIM_ACCOUNT,
+ slab_size, 0, SLAB_RECLAIM_ACCOUNT |
+ SLAB_MEM_SPREAD,
NULL);
ext4_groupinfo_caches[cache_index] = cachep;
@@ -2730,19 +2731,19 @@ static void ext4_remove_debugfs_entry(void)
int __init ext4_init_mballoc(void)
{
ext4_pspace_cachep = KMEM_CACHE(ext4_prealloc_space,
- SLAB_RECLAIM_ACCOUNT);
+ SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD);
if (ext4_pspace_cachep == NULL)
return -ENOMEM;
ext4_ac_cachep = KMEM_CACHE(ext4_allocation_context,
- SLAB_RECLAIM_ACCOUNT);
+ SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD);
if (ext4_ac_cachep == NULL) {
kmem_cache_destroy(ext4_pspace_cachep);
return -ENOMEM;
}
ext4_free_ext_cachep = KMEM_CACHE(ext4_free_data,
- SLAB_RECLAIM_ACCOUNT);
+ SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD);
if (ext4_free_ext_cachep == NULL) {
kmem_cache_destroy(ext4_pspace_cachep);
kmem_cache_destroy(ext4_ac_cachep);
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 7ce1d0b..4f848e0 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -34,10 +34,12 @@ static struct kmem_cache *io_page_cachep, *io_end_cachep;
int __init ext4_init_pageio(void)
{
- io_page_cachep = KMEM_CACHE(ext4_io_page, SLAB_RECLAIM_ACCOUNT);
+ io_page_cachep = KMEM_CACHE(ext4_io_page, SLAB_RECLAIM_ACCOUNT |
+ SLAB_MEM_SPREAD);
if (io_page_cachep == NULL)
return -ENOMEM;
- io_end_cachep = KMEM_CACHE(ext4_io_end, SLAB_RECLAIM_ACCOUNT);
+ io_end_cachep = KMEM_CACHE(ext4_io_end, SLAB_RECLAIM_ACCOUNT |
+ SLAB_MEM_SPREAD);
if (io_end_cachep == NULL) {
kmem_cache_destroy(io_page_cachep);
return -ENOMEM;
--
1.7.4.4
next reply other threads:[~2011-11-16 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 15:04 Namjae Jeon [this message]
2011-11-16 15:51 ` [PATCH] ext4: slab caches set to SLAB_MEM_SPREAD flags Theodore Tso
2011-11-16 21:52 ` David Rientjes
2011-11-17 5:11 ` Amit Sahrawat
2011-11-17 5:35 ` NamJae Jeon
2011-11-17 15:11 ` Theodore Tso
2011-11-17 21:34 ` Theodore Tso
2011-11-19 13:52 ` NamJae Jeon
2011-11-19 14:42 ` Theodore Tso
2011-11-19 15:40 ` NamJae Jeon
2011-11-19 21:14 ` Theodore Tso
2011-11-19 22:22 ` NamJae Jeon
2011-11-19 21:06 ` Theodore Tso
2011-11-19 22:16 ` NamJae Jeon
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=1321455848-1929-1-git-send-email-linkinjeon@gmail.com \
--to=linkinjeon@gmail.com \
--cc=amit.sahrawat83@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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