From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] Remove vfs_init_caches_early()
Date: Fri, 18 Jan 2008 10:41:21 +1100 [thread overview]
Message-ID: <200801181041.22157.rusty@rustcorp.com.au> (raw)
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.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
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(-)
diff -r e4dd27867542 Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt Fri Jan 18 09:59:22 2008 +1100
+++ b/Documentation/kernel-parameters.txt Fri Jan 18 10:07:13 2008 +1100
@@ -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
diff -r e4dd27867542 fs/dcache.c
--- a/fs/dcache.c Fri Jan 18 09:59:22 2008 +1100
+++ b/fs/dcache.c Fri Jan 18 10:07:13 2008 +1100
@@ -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_mo
struct 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)
{
diff -r e4dd27867542 fs/inode.c
--- a/fs/inode.c Fri Jan 18 09:59:22 2008 +1100
+++ b/fs/inode.c Fri Jan 18 10:07:13 2008 +1100
@@ -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",
diff -r e4dd27867542 include/linux/fs.h
--- a/include/linux/fs.h Fri Jan 18 09:59:22 2008 +1100
+++ b/include/linux/fs.h Fri Jan 18 10:07:13 2008 +1100
@@ -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 __user
extern 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;
diff -r e4dd27867542 init/main.c
--- a/init/main.c Fri Jan 18 09:59:22 2008 +1100
+++ b/init/main.c Fri Jan 18 10:07:13 2008 +1100
@@ -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();
next reply other threads:[~2008-01-17 23:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 23:41 Rusty Russell [this message]
2008-01-18 1:15 ` [PATCH] Remove vfs_init_caches_early() Rusty Russell
2008-01-18 1:16 ` Nick Piggin
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=200801181041.22157.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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