Remove vfs_init_caches_early()
Subsystems (2)
PATCH 1/1 Remove vfs_init_caches_early()
vfs_init_caches_early() does nothing on IA-64 and x86-64 (unless you turn off CONFIG_NUMA): hashdist is set by default on these platforms.
Maybe some obscure feature which requires VFS to be set up v. early (hence is broken in this configuration), or something arch-specific (which seems unlikely). Most likely this is a relic.
Unless someone has inside knowledge, the easiest way to find out is to rip it out and see if anyone screams. Boots fine on my 32-bit x86 box here.
--- Documentation/kernel-parameters.txt | 2 +- fs/dcache.c | 34 ---------------------------------- fs/inode.c | 31 ------------------------------- include/linux/fs.h | 2 -- init/main.c | 1 - 5 files changed, 1 insertion(+), 69 deletions(-)
Documentation/kernel-parameters.txt +1 -1
@@ -662,7 +662,7 @@ and is between 256 and 4096 characters. hashdist= [KNL,NUMA] Large hashes allocated during boot are distributed across NUMA nodes. Defaults on - for IA-64, off otherwise. + for IA-64 and x86-64, off otherwise. Format: 0 | 1 (for off | on) hcl= [IA-64] SGI's Hardware Graph compatibility layer
fs/dcache.c +0 -34
@@ -2082,30 +2082,6 @@ static int __init set_dhash_entries(char }__setup ("dhash_entries=" , set_dhash_entries); -static void __init dcache_init_early (void ) -{ -int loop; - -/* If hashes are distributed across NUMA nodes, defer -* hash allocation until vmalloc space is available. -*/ -if (hashdist) -return ; - - dentry_hashtable = -alloc_large_system_hash ("Dentry cache" , -sizeof (struct hlist_head ), - dhash_entries, -13 , -HASH_EARLY , - &d_hash_shift, - &d_hash_mask, -0 ); - -for (loop =0 ; loop < (1 << d_hash_shift); loop++) -INIT_HLIST_HEAD (&dentry_hashtable[loop]); -} -static void __init dcache_init (void ) {int loop;
@@ -2119,10 +2095,6 @@ static void __init dcache_init(void) SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);register_shrinker (&dcache_shrinker); - -/* Hash may have been set up in dcache_init_early */ -if (!hashdist) -return ; dentry_hashtable = alloc_large_system_hash("Dentry cache",
@@ -2145,12 +2117,6 @@ struct kmem_cache *filp_cachep __read_mostruct kmem_cache *filp_cachep__read_mostly ;EXPORT_SYMBOL (d_genocide); - -void __init vfs_caches_init_early (void ) -{ -dcache_init_early (); -inode_init_early (); -}void __init vfs_caches_init (unsigned long mempages) {
fs/inode.c +0 -31
@@ -1369,33 +1369,6 @@ static int __init set_ihash_entries(char }__setup ("ihash_entries=" , set_ihash_entries); -/* -* Initialize the waitqueues and inode hash table. -*/ -void __init inode_init_early (void ) -{ -int loop; - -/* If hashes are distributed across NUMA nodes, defer -* hash allocation until vmalloc space is available. -*/ -if (hashdist) -return ; - - inode_hashtable = -alloc_large_system_hash ("Inode-cache" , -sizeof (struct hlist_head ), - ihash_entries, -14 , -HASH_EARLY , - &i_hash_shift, - &i_hash_mask, -0 ); - -for (loop =0 ; loop < (1 << i_hash_shift); loop++) -INIT_HLIST_HEAD (&inode_hashtable[loop]); -} -void __init inode_init (void ) {int loop;
@@ -1408,10 +1381,6 @@ void __init inode_init(void) SLAB_MEM_SPREAD), init_once);register_shrinker (&icache_shrinker); - -/* Hash may have been set up in inode_init_early */ -if (!hashdist) -return ; inode_hashtable = alloc_large_system_hash("Inode-cache",
include/linux/fs.h +0 -2
@@ -302,7 +302,6 @@ struct vfsmount;struct vfsmount ;extern void __init inode_init (void ); -extern void __init inode_init_early (void );extern void __init mnt_init (void );extern void __init files_init (unsigned long );
@@ -1546,7 +1545,6 @@ extern char * getname(const char __userextern char *getname (const char __user *);/* fs/dcache.c */ -extern void __init vfs_caches_init_early (void );extern void __init vfs_caches_init (unsigned long );extern struct kmem_cache *names_cachep;
init/main.c +0 -1
@@ -604,7 +604,6 @@ asmlinkage void __init start_kernel(void initrd_start = 0; }#endif -vfs_caches_init_early ();cpuset_init_early ();mem_init ();kmem_cache_init ();
Quoted 10 lines · On Friday 18 January 2008 10:41:21 Rusty Russell wrote:
vfs_init_caches_early()does nothing on IA-64 and x86-64 (unless you turn offCONFIG_NUMA): hashdist is set by default on these platforms.Maybe some obscure feature which requires VFS to be set up v. early (hence is broken in this configuration), or something arch-specific (which seems unlikely). Most likely this is a relic.
Unless someone has inside knowledge, the easiest way to find out is to rip it out and see if anyone screams. Boots fine on my 32-bit x86 box here.
Ok, Chris Wright pointed me to the justification: it was because on 64G powerpc machines, MAX_ORDER of 11 was too small to allocate sufficient hashes.
Since MAX_ORDER is now 13 on powerpc, I think we're good.
Thanks Cdub!
Rusty.
Quoted 6 lines · Rusty Russell
vfs_init_caches_early()does nothing on IA-64 and x86-64 (unless you turn offCONFIG_NUMA): hashdist is set by default on these platforms.Maybe some obscure feature which requires VFS to be set up v. early (hence is broken in this configuration), or something arch-specific (which seems unlikely).
The use of hugepage mappings for your hashes rather than vmalloc memory? Or did I misunderstand you? ... bootmem is needed for very large physically contiguous allocations.