Whamcloud - gitweb
b=23179 MDS node unresponsive
[fs/lustre-release.git] / lnet / lnet / api-ni.c
index 07069db..3b97ea5 100644 (file)
@@ -482,7 +482,7 @@ lnet_setup_handle_hash (void)
         /* Arbitrary choice of hash table size */
 #ifdef __KERNEL__
         the_lnet.ln_lh_hash_size =
-                CFS_PAGE_SIZE / sizeof (cfs_list_t);
+                (2 * CFS_PAGE_SIZE) / sizeof (cfs_list_t);
 #else
         the_lnet.ln_lh_hash_size = (MAX_MES + MAX_MDS + MAX_EQS)/4;
 #endif
@@ -520,7 +520,7 @@ lnet_lookup_cookie (__u64 cookie, int type)
         if ((cookie & (LNET_COOKIE_TYPES - 1)) != type)
                 return (NULL);
 
-        hash = ((unsigned int)cookie) % the_lnet.ln_lh_hash_size;
+        hash = ((unsigned int)(cookie >> LNET_COOKIE_TYPE_BITS)) % the_lnet.ln_lh_hash_size;
         list = &the_lnet.ln_lh_hash_table[hash];
 
         cfs_list_for_each (el, list) {
@@ -544,7 +544,7 @@ lnet_initialise_handle (lnet_libhandle_t *lh, int type)
         lh->lh_cookie = the_lnet.ln_next_object_cookie | type;
         the_lnet.ln_next_object_cookie += LNET_COOKIE_TYPES;
 
-        hash = ((unsigned int)lh->lh_cookie) % the_lnet.ln_lh_hash_size;
+        hash = ((unsigned int)(lh->lh_cookie >> LNET_COOKIE_TYPE_BITS)) % the_lnet.ln_lh_hash_size;
         cfs_list_add (&lh->lh_hash_chain, &the_lnet.ln_lh_hash_table[hash]);
 }