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 | |
| 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')
| -rw-r--r-- | kernel/locking/qspinlock_paravirt.h | 3 | ||||
| -rw-r--r-- | kernel/pid.c | 7 |
2 files changed, 4 insertions, 6 deletions
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 | */ |
| 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) |
