Messages in this thread | | | Date | Fri, 11 Jun 2004 15:01:10 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] Permit inode & dentry hash tables to be allocated > MAX_ORDER size [#2] |
| |
David Howells <dhowells@redhat.com> wrote: > > Here's an update to my patch.
-static void __init dcache_init(unsigned long mempages) +static void __init dcache_init_early(void) { - struct hlist_head *d; - unsigned long order; - unsigned int nr_hash; - int i; + struct hlist_head *p; + int loop; + + dentry_hashtable = + alloc_large_system_hash("Dentry cache", + sizeof(struct hlist_head), + dhash_entries, + 13, + 0, + &d_hash_shift, + &d_hash_mask); + + p = dentry_hashtable; + loop = 1 << d_hash_shift; + do { + INIT_HLIST_HEAD(p); + p++; + loop--; + } while (loop); +}
We have an opportunity to make this loop less baroque.
for (i = 0; i < (1 << d_hash_shift); i++) INIT_HLIST_HEAD(p[i]);
+void __init vfs_caches_init_early(void)
This function was declared
+extern void vfs_caches_init_early(void);
whereas in other places you _have_ made the definition of __init functions include the "__init". I'm not sure which is best, really, but it seems better to include the __init in the declaration.
+static inline int log2(unsigned long x) __attribute__((pure));
What's the attribute((pure)) for?
It generates a warning on older gcc - please use __attribute_pure__.
+static inline int log2(unsigned long x)
This is just asking for namespace collisions.
+{ + int r = 0; + for (x >>= 1; x > 0; x >>= 1) + r++; + return r; +}
The other four or five implementations of log2() use ffx(~n).
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |