summaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@oracle.com>2017-07-06 18:39:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 19:24:33 -0400
commit3d375d78593cd5daeead34ed3279c4ff63dd04f2 (patch)
tree7c18820dd87b42ca28cb808245ef72d17671c6a3 /fs/inode.c
parent3749a8f008eac3355a9e50b366ba08317a7e9cf8 (diff)
mm: update callers to use HASH_ZERO flag
Update dcache, inode, pid, mountpoint, and mount hash tables to use HASH_ZERO, and remove initialization after allocations. In case of places where HASH_EARLY was used such as in __pv_init_lock_hash the zeroed hash table was already assumed, because memblock zeroes the memory. CPU: SPARC M6, Memory: 7T Before fix: Dentry cache hash table entries: 1073741824 Inode-cache hash table entries: 536870912 Mount-cache hash table entries: 16777216 Mountpoint-cache hash table entries: 16777216 ftrace: allocating 20414 entries in 40 pages Total time: 11.798s After fix: Dentry cache hash table entries: 1073741824 Inode-cache hash table entries: 536870912 Mount-cache hash table entries: 16777216 Mountpoint-cache hash table entries: 16777216 ftrace: allocating 20414 entries in 40 pages Total time: 3.198s CPU: Intel Xeon E5-2630, Memory: 2.2T: Before fix: Dentry cache hash table entries: 536870912 Inode-cache hash table entries: 268435456 Mount-cache hash table entries: 8388608 Mountpoint-cache hash table entries: 8388608 CPU: Physical Processor ID: 0 Total time: 3.245s After fix: Dentry cache hash table entries: 536870912 Inode-cache hash table entries: 268435456 Mount-cache hash table entries: 8388608 Mountpoint-cache hash table entries: 8388608 CPU: Physical Processor ID: 0 Total time: 3.244s Link: http://lkml.kernel.org/r/1488432825-92126-4-git-send-email-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com> Reviewed-by: Babu Moger <babu.moger@oracle.com> Cc: David Miller <davem@davemloft.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c14
1 files changed, 2 insertions, 12 deletions
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)