diff options
author | Pavel Tatashin <pasha.tatashin@oracle.com> | 2017-07-06 18:39:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 19:24:33 -0400 |
commit | 3d375d78593cd5daeead34ed3279c4ff63dd04f2 (patch) | |
tree | 7c18820dd87b42ca28cb808245ef72d17671c6a3 /kernel/pid.c | |
parent | 3749a8f008eac3355a9e50b366ba08317a7e9cf8 (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 'kernel/pid.c')
-rw-r--r-- | kernel/pid.c | 7 |
1 files changed, 2 insertions, 5 deletions
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 | */ |
576 | void __init pidhash_init(void) | 576 | void __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 | ||
590 | void __init pidmap_init(void) | 587 | void __init pidmap_init(void) |