]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: lustre: obdclass: limit lu_site hash table size on clients
authorLi Dongyang <dongyang.li@anu.edu.au>
Sat, 3 Dec 2016 00:53:17 +0000 (19:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Dec 2016 09:54:33 +0000 (10:54 +0100)
Allocating a big hash table using the current formula
does not really work for clients. We will create new
hash table for each mount on a single client which is
a lot of memory more than expected.

This patch limits the hash table up to 8M for clients,
which has 524288 entries.

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7689
Reviewed-on: http://review.whamcloud.com/18048
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/lu_object.c

index a02aaa3a3b37c4de8d88d84384c81414f5a76820..80e09846e3bec641a3a6b28aece1b6259c890059 100644 (file)
@@ -68,6 +68,7 @@ enum {
 
 #define LU_SITE_BITS_MIN       12
 #define LU_SITE_BITS_MAX       24
+#define LU_SITE_BITS_MAX_CL    19
 /**
  * total 256 buckets, we don't want too many buckets because:
  * - consume too much memory
@@ -878,6 +879,9 @@ static unsigned long lu_htable_order(struct lu_device *top)
        unsigned long cache_size;
        unsigned long bits;
 
+       if (!strcmp(top->ld_type->ldt_name, LUSTRE_VVP_NAME))
+               bits_max = LU_SITE_BITS_MAX_CL;
+
        /*
         * Calculate hash table size, assuming that we want reasonable
         * performance when 20% of total memory is occupied by cache of