aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@oracle.com>2017-03-19 21:01:35 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-03-19 21:01:35 +1100
commit3624db8c93788f86eeb16a2d50834b9531751a4b (patch)
tree30d55729ebb7abc2f75d23f3df24e0416252d10e /fs
parent569e7891977f37820a85bb092010abc3d60b5230 (diff)
mm: adaptive hash table scaling
Allow hash tables to scale with memory but at slower pace, when HASH_ADAPT is provided every time memory quadruples the sizes of hash tables will only double instead of quadrupling as well. This algorithm starts working only when memory size reaches a certain point, currently set to 64G. This is example of dentry hash table size, before and after four various memory configurations: MEMORY SCALE HASH_SIZE old new old new 8G 13 13 8M 8M 16G 13 13 16M 16M 32G 13 13 32M 32M 64G 13 13 64M 64M 128G 13 14 128M 64M 256G 13 14 256M 128M 512G 13 15 512M 128M 1024G 13 15 1024M 256M 2048G 13 16 2048M 256M 4096G 13 16 4096M 512M 8192G 13 17 8192M 512M 16384G 13 17 16384M 1024M 32768G 13 18 32768M 1024M 65536G 13 18 65536M 2048M Link: http://lkml.kernel.org/r/1488432825-92126-5-git-send-email-pasha.tatashin@oracle.com Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com> Cc: David Miller <davem@davemloft.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Babu Moger <babu.moger@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/inode.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 363502faa328..808ea99062c2 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3585,7 +3585,7 @@ static void __init dcache_init(void)
sizeof(struct hlist_bl_head),
dhash_entries,
13,
- HASH_ZERO,
+ HASH_ZERO | HASH_ADAPT,
&d_hash_shift,
&d_hash_mask,
0,
diff --git a/fs/inode.c b/fs/inode.c
index 1b15a7cc78ce..32c8ee454ef0 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1953,7 +1953,7 @@ void __init inode_init(void)
sizeof(struct hlist_head),
ihash_entries,
14,
- HASH_ZERO,
+ HASH_ZERO | HASH_ADAPT,
&i_hash_shift,
&i_hash_mask,
0,