* [PATCH] Remove vfs_init_caches_early()
@ 2008-01-17 23:41 Rusty Russell
2008-01-18 1:15 ` Rusty Russell
2008-01-18 1:16 ` Nick Piggin
0 siblings, 2 replies; 3+ messages in thread
From: Rusty Russell @ 2008-01-17 23:41 UTC (permalink / raw)
To: linux-kernel; +Cc: Al Viro, Andrew Morton
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();
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove vfs_init_caches_early()
2008-01-17 23:41 [PATCH] Remove vfs_init_caches_early() Rusty Russell
@ 2008-01-18 1:15 ` Rusty Russell
2008-01-18 1:16 ` Nick Piggin
1 sibling, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2008-01-18 1:15 UTC (permalink / raw)
To: linux-kernel
Cc: Al Viro, Andrew Morton, Chris Wright, David Howells,
Paul Mackerras
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 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.
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.
See
http://git.kernel.org/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=50c2cb5183e4f101f923212e39a58a66a530cf77
Since MAX_ORDER is now 13 on powerpc, I think we're good.
Thanks Cdub!
Rusty.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Remove vfs_init_caches_early()
2008-01-17 23:41 [PATCH] Remove vfs_init_caches_early() Rusty Russell
2008-01-18 1:15 ` Rusty Russell
@ 2008-01-18 1:16 ` Nick Piggin
1 sibling, 0 replies; 3+ messages in thread
From: Nick Piggin @ 2008-01-18 1:16 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel, Al Viro, Andrew Morton
On Friday 18 January 2008 10:41, Rusty Russell wrote:
> 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).
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-18 1:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17 23:41 [PATCH] Remove vfs_init_caches_early() Rusty Russell
2008-01-18 1:15 ` Rusty Russell
2008-01-18 1:16 ` Nick Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox