提交 16828088 编写于 作者: T Theodore Ts'o

ext4: use KMEM_CACHE instead of kmem_cache_create

Also remove the SLAB_RECLAIM_ACCOUNT flag from the system zone kmem
cache.  This slab tends to be fairly static, so it shouldn't be marked
as likely to have free pages that can be reclaimed.
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 7845c049
...@@ -31,8 +31,7 @@ static struct kmem_cache *ext4_system_zone_cachep; ...@@ -31,8 +31,7 @@ static struct kmem_cache *ext4_system_zone_cachep;
int __init init_ext4_system_zone(void) int __init init_ext4_system_zone(void)
{ {
ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, 0);
SLAB_RECLAIM_ACCOUNT);
if (ext4_system_zone_cachep == NULL) if (ext4_system_zone_cachep == NULL)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
...@@ -2706,26 +2706,20 @@ static void ext4_remove_debugfs_entry(void) ...@@ -2706,26 +2706,20 @@ static void ext4_remove_debugfs_entry(void)
int __init init_ext4_mballoc(void) int __init init_ext4_mballoc(void)
{ {
ext4_pspace_cachep = ext4_pspace_cachep = KMEM_CACHE(ext4_prealloc_space,
kmem_cache_create("ext4_prealloc_space", SLAB_RECLAIM_ACCOUNT);
sizeof(struct ext4_prealloc_space),
0, SLAB_RECLAIM_ACCOUNT, NULL);
if (ext4_pspace_cachep == NULL) if (ext4_pspace_cachep == NULL)
return -ENOMEM; return -ENOMEM;
ext4_ac_cachep = ext4_ac_cachep = KMEM_CACHE(ext4_allocation_context,
kmem_cache_create("ext4_alloc_context", SLAB_RECLAIM_ACCOUNT);
sizeof(struct ext4_allocation_context),
0, SLAB_RECLAIM_ACCOUNT, NULL);
if (ext4_ac_cachep == NULL) { if (ext4_ac_cachep == NULL) {
kmem_cache_destroy(ext4_pspace_cachep); kmem_cache_destroy(ext4_pspace_cachep);
return -ENOMEM; return -ENOMEM;
} }
ext4_free_ext_cachep = ext4_free_ext_cachep = KMEM_CACHE(ext4_free_data,
kmem_cache_create("ext4_free_block_extents", SLAB_RECLAIM_ACCOUNT);
sizeof(struct ext4_free_data),
0, SLAB_RECLAIM_ACCOUNT, NULL);
if (ext4_free_ext_cachep == NULL) { if (ext4_free_ext_cachep == NULL) {
kmem_cache_destroy(ext4_pspace_cachep); kmem_cache_destroy(ext4_pspace_cachep);
kmem_cache_destroy(ext4_ac_cachep); kmem_cache_destroy(ext4_ac_cachep);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册