aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dcache.c18
-rw-r--r--fs/inode.c14
-rw-r--r--fs/namespace.c10
-rw-r--r--kernel/locking/qspinlock_paravirt.h3
-rw-r--r--kernel/pid.c7
5 files changed, 12 insertions, 40 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index a9f995f6859e..a140fe1dbb1a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3546,8 +3546,6 @@ __setup("dhash_entries=", set_dhash_entries);
3546 3546
3547static void __init dcache_init_early(void) 3547static void __init dcache_init_early(void)
3548{ 3548{
3549 unsigned int loop;
3550
3551 /* If hashes are distributed across NUMA nodes, defer 3549 /* If hashes are distributed across NUMA nodes, defer
3552 * hash allocation until vmalloc space is available. 3550 * hash allocation until vmalloc space is available.
3553 */ 3551 */
@@ -3559,24 +3557,19 @@ static void __init dcache_init_early(void)
3559 sizeof(struct hlist_bl_head), 3557 sizeof(struct hlist_bl_head),
3560 dhash_entries, 3558 dhash_entries,
3561 13, 3559 13,
3562 HASH_EARLY, 3560 HASH_EARLY | HASH_ZERO,
3563 &d_hash_shift, 3561 &d_hash_shift,
3564 &d_hash_mask, 3562 &d_hash_mask,
3565 0, 3563 0,
3566 0); 3564 0);
3567
3568 for (loop = 0; loop < (1U << d_hash_shift); loop++)
3569 INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
3570} 3565}
3571 3566
3572static void __init dcache_init(void) 3567static void __init dcache_init(void)
3573{ 3568{
3574 unsigned int loop; 3569 /*
3575
3576 /*
3577 * A constructor could be added for stable state like the lists, 3570 * A constructor could be added for stable state like the lists,
3578 * but it is probably not worth it because of the cache nature 3571 * but it is probably not worth it because of the cache nature
3579 * of the dcache. 3572 * of the dcache.
3580 */ 3573 */
3581 dentry_cache = KMEM_CACHE(dentry, 3574 dentry_cache = KMEM_CACHE(dentry,
3582 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT); 3575 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT);
@@ -3590,14 +3583,11 @@ static void __init dcache_init(void)
3590 sizeof(struct hlist_bl_head), 3583 sizeof(struct hlist_bl_head),
3591 dhash_entries, 3584 dhash_entries,
3592 13, 3585 13,
3593 0, 3586 HASH_ZERO,
3594 &d_hash_shift, 3587 &d_hash_shift,
3595 &d_hash_mask, 3588 &d_hash_mask,
3596 0, 3589 0,
3597 0); 3590 0);
3598
3599 for (loop = 0; loop < (1U << d_hash_shift); loop++)
3600 INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
3601} 3591}
3602 3592
3603/* SLAB cache for __getname() consumers */ 3593/* SLAB cache for __getname() consumers */
diff --git a/fs/inode.c b/fs/inode.c
index ab3b9a795c0b..5cbc8e6e9390 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1915,8 +1915,6 @@ __setup("ihash_entries=", set_ihash_entries);
1915 */ 1915 */
1916void __init inode_init_early(void) 1916void __init inode_init_early(void)
1917{ 1917{
1918 unsigned int loop;
1919
1920 /* If hashes are distributed across NUMA nodes, defer 1918 /* If hashes are distributed across NUMA nodes, defer
1921 * hash allocation until vmalloc space is available. 1919 * hash allocation until vmalloc space is available.
1922 */ 1920 */
@@ -1928,20 +1926,15 @@ void __init inode_init_early(void)
1928 sizeof(struct hlist_head), 1926 sizeof(struct hlist_head),
1929 ihash_entries, 1927 ihash_entries,
1930 14, 1928 14,
1931 HASH_EARLY, 1929 HASH_EARLY | HASH_ZERO,
1932 &i_hash_shift, 1930 &i_hash_shift,
1933 &i_hash_mask, 1931 &i_hash_mask,
1934 0, 1932 0,
1935 0); 1933 0);
1936
1937 for (loop = 0; loop < (1U << i_hash_shift); loop++)
1938 INIT_HLIST_HEAD(&inode_hashtable[loop]);
1939} 1934}
1940 1935
1941void __init inode_init(void) 1936void __init inode_init(void)
1942{ 1937{
1943 unsigned int loop;
1944
1945 /* inode slab cache */ 1938 /* inode slab cache */
1946 inode_cachep = kmem_cache_create("inode_cache", 1939 inode_cachep = kmem_cache_create("inode_cache",
1947 sizeof(struct inode), 1940 sizeof(struct inode),
@@ -1959,14 +1952,11 @@ void __init inode_init(void)
1959 sizeof(struct hlist_head), 1952 sizeof(struct hlist_head),
1960 ihash_entries, 1953 ihash_entries,
1961 14, 1954 14,
1962 0, 1955 HASH_ZERO,
1963 &i_hash_shift, 1956 &i_hash_shift,
1964 &i_hash_mask, 1957 &i_hash_mask,
1965 0, 1958 0,
1966 0); 1959 0);
1967
1968 for (loop = 0; loop < (1U << i_hash_shift); loop++)
1969 INIT_HLIST_HEAD(&inode_hashtable[loop]);
1970} 1960}
1971 1961
1972void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev) 1962void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
diff --git a/fs/namespace.c b/fs/namespace.c
index f70914a859a4..81f934b5d571 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3239,7 +3239,6 @@ static void __init init_mount_tree(void)
3239 3239
3240void __init mnt_init(void) 3240void __init mnt_init(void)
3241{ 3241{
3242 unsigned u;
3243 int err; 3242 int err;
3244 3243
3245 mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), 3244 mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount),
@@ -3248,22 +3247,17 @@ void __init mnt_init(void)
3248 mount_hashtable = alloc_large_system_hash("Mount-cache", 3247 mount_hashtable = alloc_large_system_hash("Mount-cache",
3249 sizeof(struct hlist_head), 3248 sizeof(struct hlist_head),
3250 mhash_entries, 19, 3249 mhash_entries, 19,
3251 0, 3250 HASH_ZERO,
3252 &m_hash_shift, &m_hash_mask, 0, 0); 3251 &m_hash_shift, &m_hash_mask, 0, 0);
3253 mountpoint_hashtable = alloc_large_system_hash("Mountpoint-cache", 3252 mountpoint_hashtable = alloc_large_system_hash("Mountpoint-cache",
3254 sizeof(struct hlist_head), 3253 sizeof(struct hlist_head),
3255 mphash_entries, 19, 3254 mphash_entries, 19,
3256 0, 3255 HASH_ZERO,
3257 &mp_hash_shift, &mp_hash_mask, 0, 0); 3256 &mp_hash_shift, &mp_hash_mask, 0, 0);
3258 3257
3259 if (!mount_hashtable || !mountpoint_hashtable) 3258 if (!mount_hashtable || !mountpoint_hashtable)
3260 panic("Failed to allocate mount hash table\n"); 3259 panic("Failed to allocate mount hash table\n");
3261 3260
3262 for (u = 0; u <= m_hash_mask; u++)
3263 INIT_HLIST_HEAD(&mount_hashtable[u]);
3264 for (u = 0; u <= mp_hash_mask; u++)
3265 INIT_HLIST_HEAD(&mountpoint_hashtable[u]);
3266
3267 kernfs_init(); 3261 kernfs_init();
3268 3262
3269 err = sysfs_init(); 3263 err = sysfs_init();
diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h
index e6b2f7ad3e51..4ccfcaae5b89 100644
--- a/kernel/locking/qspinlock_paravirt.h
+++ b/kernel/locking/qspinlock_paravirt.h
@@ -193,7 +193,8 @@ void __init __pv_init_lock_hash(void)
193 */ 193 */
194 pv_lock_hash = alloc_large_system_hash("PV qspinlock", 194 pv_lock_hash = alloc_large_system_hash("PV qspinlock",
195 sizeof(struct pv_hash_entry), 195 sizeof(struct pv_hash_entry),
196 pv_hash_size, 0, HASH_EARLY, 196 pv_hash_size, 0,
197 HASH_EARLY | HASH_ZERO,
197 &pv_lock_hash_bits, NULL, 198 &pv_lock_hash_bits, NULL,
198 pv_hash_size, pv_hash_size); 199 pv_hash_size, pv_hash_size);
199} 200}
diff --git a/kernel/pid.c b/kernel/pid.c
index fd1cde1e4576..731c4e528f4e 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -575,16 +575,13 @@ struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
575 */ 575 */
576void __init pidhash_init(void) 576void __init pidhash_init(void)
577{ 577{
578 unsigned int i, pidhash_size; 578 unsigned int pidhash_size;
579 579
580 pid_hash = alloc_large_system_hash("PID", sizeof(*pid_hash), 0, 18, 580 pid_hash = alloc_large_system_hash("PID", sizeof(*pid_hash), 0, 18,
581 HASH_EARLY | HASH_SMALL, 581 HASH_EARLY | HASH_SMALL | HASH_ZERO,
582 &pidhash_shift, NULL, 582 &pidhash_shift, NULL,
583 0, 4096); 583 0, 4096);
584 pidhash_size = 1U << pidhash_shift; 584 pidhash_size = 1U << pidhash_shift;
585
586 for (i = 0; i < pidhash_size; i++)
587 INIT_HLIST_HEAD(&pid_hash[i]);
588} 585}
589 586
590void __init pidmap_init(void) 587void __init pidmap_init(void)