1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/obdclass/class_hash.c
38 * Implement a hash class for hash process in lustre system.
40 * Author: YuZhangyong <yzy@clusterfs.com>
42 * 2008-08-15: Brian Behlendorf <behlendorf1@llnl.gov>
43 * - Simplified API and improved documentation
44 * - Added per-hash feature flags:
45 * * LH_DEBUG additional validation
46 * * LH_REHASH dynamic rehashing
47 * - Added per-hash statistics
48 * - General performance enhancements
52 #include <liblustre.h>
56 #include <class_hash.h>
59 * Initialize new lustre hash, where:
60 * @name - Descriptive hash name
61 * @cur_size - Initial hash table size
62 * @max_size - Maximum allowed hash table resize
63 * @ops - Registered hash table operations
64 * @flags - LH_REHASH enable synamic hash resizing
65 * - LH_SORT enable chained hash sort
68 lustre_hash_init(char *name, unsigned int cur_size, unsigned int max_size,
69 lustre_hash_ops_t *ops, int flags)
75 LASSERT(name != NULL);
79 * Ensure hash is a power of two to allow the use of a bitmask
80 * in the hash function instead of a more expensive modulus.
82 LASSERTF(cur_size && (cur_size & (cur_size - 1)) == 0,
83 "Size (%u) is not power of 2\n", cur_size);
84 LASSERTF(max_size && (max_size & (max_size - 1)) == 0,
85 "Size (%u) is not power of 2\n", max_size);
91 strncpy(lh->lh_name, name, sizeof(lh->lh_name));
92 atomic_set(&lh->lh_rehash_count, 0);
93 atomic_set(&lh->lh_count, 0);
94 rwlock_init(&lh->lh_rwlock);
95 lh->lh_cur_size = cur_size;
96 lh->lh_min_size = cur_size;
97 lh->lh_max_size = max_size;
98 lh->lh_min_theta = 500; /* theta * 1000 */
99 lh->lh_max_theta = 2000; /* theta * 1000 */
101 lh->lh_flags = flags;
103 OBD_VMALLOC(lh->lh_buckets, sizeof(*lh->lh_buckets) * lh->lh_cur_size);
104 if (!lh->lh_buckets) {
109 for (i = 0; i < lh->lh_cur_size; i++) {
110 INIT_HLIST_HEAD(&lh->lh_buckets[i].lhb_head);
111 rwlock_init(&lh->lh_buckets[i].lhb_rwlock);
112 atomic_set(&lh->lh_buckets[i].lhb_count, 0);
117 EXPORT_SYMBOL(lustre_hash_init);
120 * Cleanup lustre hash @lh.
123 lustre_hash_exit(lustre_hash_t *lh)
125 lustre_hash_bucket_t *lhb;
126 struct hlist_node *hnode;
127 struct hlist_node *pos;
133 write_lock(&lh->lh_rwlock);
135 lh_for_each_bucket(lh, lhb, i) {
136 write_lock(&lhb->lhb_rwlock);
137 hlist_for_each_safe(hnode, pos, &(lhb->lhb_head)) {
138 __lustre_hash_bucket_validate(lh, lhb, hnode);
139 __lustre_hash_bucket_del(lh, lhb, hnode);
143 LASSERT(hlist_empty(&(lhb->lhb_head)));
144 LASSERT(atomic_read(&lhb->lhb_count) == 0);
145 write_unlock(&lhb->lhb_rwlock);
148 OBD_VFREE(lh->lh_buckets, sizeof(*lh->lh_buckets) * lh->lh_cur_size);
149 LASSERT(atomic_read(&lh->lh_count) == 0);
150 write_unlock(&lh->lh_rwlock);
155 EXPORT_SYMBOL(lustre_hash_exit);
157 static inline unsigned int lustre_hash_rehash_size(lustre_hash_t *lh)
159 if (!(lh->lh_flags & LH_REHASH))
162 if ((lh->lh_cur_size < lh->lh_max_size) &&
163 (__lustre_hash_theta(lh) > lh->lh_max_theta))
164 return MIN(lh->lh_cur_size * 2, lh->lh_max_size);
166 if ((lh->lh_cur_size > lh->lh_min_size) &&
167 (__lustre_hash_theta(lh) < lh->lh_min_theta))
168 return MAX(lh->lh_cur_size / 2, lh->lh_min_size);
174 * Add item @hnode to lustre hash @lh using @key. The registered
175 * ops->lh_get function will be called when the item is added.
178 lustre_hash_add(lustre_hash_t *lh, void *key, struct hlist_node *hnode)
180 lustre_hash_bucket_t *lhb;
185 __lustre_hash_key_validate(lh, key, hnode);
187 read_lock(&lh->lh_rwlock);
188 i = lh_hash(lh, key, lh->lh_cur_size - 1);
189 lhb = &lh->lh_buckets[i];
190 LASSERT(i < lh->lh_cur_size);
191 LASSERT(hlist_unhashed(hnode));
193 write_lock(&lhb->lhb_rwlock);
194 __lustre_hash_bucket_add(lh, lhb, hnode);
195 write_unlock(&lhb->lhb_rwlock);
197 size = lustre_hash_rehash_size(lh);
198 read_unlock(&lh->lh_rwlock);
200 lustre_hash_rehash(lh, size);
204 EXPORT_SYMBOL(lustre_hash_add);
206 static struct hlist_node *
207 lustre_hash_findadd_unique_hnode(lustre_hash_t *lh, void *key,
208 struct hlist_node *hnode)
210 struct hlist_node *ehnode;
211 lustre_hash_bucket_t *lhb;
216 __lustre_hash_key_validate(lh, key, hnode);
218 read_lock(&lh->lh_rwlock);
219 i = lh_hash(lh, key, lh->lh_cur_size - 1);
220 lhb = &lh->lh_buckets[i];
221 LASSERT(i < lh->lh_cur_size);
222 LASSERT(hlist_unhashed(hnode));
224 write_lock(&lhb->lhb_rwlock);
225 ehnode = __lustre_hash_bucket_lookup(lh, lhb, key);
229 __lustre_hash_bucket_add(lh, lhb, hnode);
232 write_unlock(&lhb->lhb_rwlock);
234 size = lustre_hash_rehash_size(lh);
235 read_unlock(&lh->lh_rwlock);
237 lustre_hash_rehash(lh, size);
243 * Add item @hnode to lustre hash @lh using @key. The registered
244 * ops->lh_get function will be called if the item was added.
245 * Returns 0 on success or -EALREADY on key collisions.
248 lustre_hash_add_unique(lustre_hash_t *lh, void *key, struct hlist_node *hnode)
250 struct hlist_node *ehnode;
253 ehnode = lustre_hash_findadd_unique_hnode(lh, key, hnode);
259 EXPORT_SYMBOL(lustre_hash_add_unique);
262 * Add item @hnode to lustre hash @lh using @key. If this @key
263 * already exists in the hash then ops->lh_get will be called on the
264 * conflicting entry and that entry will be returned to the caller.
265 * Otherwise ops->lh_get is called on the item which was added.
268 lustre_hash_findadd_unique(lustre_hash_t *lh, void *key,
269 struct hlist_node *hnode)
271 struct hlist_node *ehnode;
275 ehnode = lustre_hash_findadd_unique_hnode(lh, key, hnode);
276 obj = lh_get(lh, ehnode);
280 EXPORT_SYMBOL(lustre_hash_findadd_unique);
283 * Delete item @hnode from the lustre hash @lh using @key. The @key
284 * is required to ensure the correct hash bucket is locked since there
285 * is no direct linkage from the item to the bucket. The object
286 * removed from the hash will be returned and obs->lh_put is called
287 * on the removed object.
290 lustre_hash_del(lustre_hash_t *lh, void *key, struct hlist_node *hnode)
292 lustre_hash_bucket_t *lhb;
298 __lustre_hash_key_validate(lh, key, hnode);
300 read_lock(&lh->lh_rwlock);
301 i = lh_hash(lh, key, lh->lh_cur_size - 1);
302 lhb = &lh->lh_buckets[i];
303 LASSERT(i < lh->lh_cur_size);
304 LASSERT(!hlist_unhashed(hnode));
306 write_lock(&lhb->lhb_rwlock);
307 obj = __lustre_hash_bucket_del(lh, lhb, hnode);
308 write_unlock(&lhb->lhb_rwlock);
310 size = lustre_hash_rehash_size(lh);
311 read_unlock(&lh->lh_rwlock);
313 lustre_hash_rehash(lh, size);
317 EXPORT_SYMBOL(lustre_hash_del);
320 * Delete item given @key in lustre hash @lh. The first @key found in
321 * the hash will be removed, if the key exists multiple times in the hash
322 * @lh this function must be called once per key. The removed object
323 * will be returned and ops->lh_put is called on the removed object.
326 lustre_hash_del_key(lustre_hash_t *lh, void *key)
328 struct hlist_node *hnode;
329 lustre_hash_bucket_t *lhb;
335 read_lock(&lh->lh_rwlock);
336 i = lh_hash(lh, key, lh->lh_cur_size - 1);
337 lhb = &lh->lh_buckets[i];
338 LASSERT(i < lh->lh_cur_size);
340 write_lock(&lhb->lhb_rwlock);
341 hnode = __lustre_hash_bucket_lookup(lh, lhb, key);
343 obj = __lustre_hash_bucket_del(lh, lhb, hnode);
345 write_unlock(&lhb->lhb_rwlock);
347 size = lustre_hash_rehash_size(lh);
348 read_unlock(&lh->lh_rwlock);
350 lustre_hash_rehash(lh, size);
354 EXPORT_SYMBOL(lustre_hash_del_key);
357 * Lookup an item using @key in the lustre hash @lh and return it.
358 * If the @key is found in the hash lh->lh_get() is called and the
359 * matching objects is returned. It is the callers responsibility
360 * to call the counterpart ops->lh_put using the lh_put() macro
361 * when when finished with the object. If the @key was not found
362 * in the hash @lh NULL is returned.
365 lustre_hash_lookup(lustre_hash_t *lh, void *key)
367 struct hlist_node *hnode;
368 lustre_hash_bucket_t *lhb;
373 read_lock(&lh->lh_rwlock);
374 i = lh_hash(lh, key, lh->lh_cur_size - 1);
375 lhb = &lh->lh_buckets[i];
376 LASSERT(i < lh->lh_cur_size);
378 read_lock(&lhb->lhb_rwlock);
379 hnode = __lustre_hash_bucket_lookup(lh, lhb, key);
381 obj = lh_get(lh, hnode);
383 read_unlock(&lhb->lhb_rwlock);
384 read_unlock(&lh->lh_rwlock);
388 EXPORT_SYMBOL(lustre_hash_lookup);
391 * For each item in the lustre hash @lh call the passed callback @func
392 * and pass to it as an argument each hash item and the private @data.
393 * Before each callback ops->lh_get will be called, and after each
394 * callback ops->lh_put will be called. Finally, during the callback
395 * the bucket lock is held so the callback must never sleep.
398 lustre_hash_for_each(lustre_hash_t *lh, lh_for_each_cb func, void *data)
400 struct hlist_node *hnode;
401 lustre_hash_bucket_t *lhb;
406 read_lock(&lh->lh_rwlock);
407 lh_for_each_bucket(lh, lhb, i) {
408 read_lock(&lhb->lhb_rwlock);
409 hlist_for_each(hnode, &(lhb->lhb_head)) {
410 __lustre_hash_bucket_validate(lh, lhb, hnode);
411 obj = lh_get(lh, hnode);
413 (void)lh_put(lh, hnode);
415 read_unlock(&lhb->lhb_rwlock);
417 read_unlock(&lh->lh_rwlock);
421 EXPORT_SYMBOL(lustre_hash_for_each);
424 * For each item in the lustre hash @lh call the passed callback @func
425 * and pass to it as an argument each hash item and the private @data.
426 * Before each callback ops->lh_get will be called, and after each
427 * callback ops->lh_put will be called. During the callback the
428 * bucket lock will not be held will allows for the current item
429 * to be removed from the hash during the callback. However, care
430 * should be taken to prevent other callers from operating on the
431 * hash concurrently or list corruption may occur.
434 lustre_hash_for_each_safe(lustre_hash_t *lh, lh_for_each_cb func, void *data)
436 struct hlist_node *hnode;
437 struct hlist_node *pos;
438 lustre_hash_bucket_t *lhb;
443 read_lock(&lh->lh_rwlock);
444 lh_for_each_bucket(lh, lhb, i) {
445 read_lock(&lhb->lhb_rwlock);
446 hlist_for_each_safe(hnode, pos, &(lhb->lhb_head)) {
447 __lustre_hash_bucket_validate(lh, lhb, hnode);
448 obj = lh_get(lh, hnode);
449 read_unlock(&lhb->lhb_rwlock);
451 read_lock(&lhb->lhb_rwlock);
452 (void)lh_put(lh, hnode);
454 read_unlock(&lhb->lhb_rwlock);
456 read_unlock(&lh->lh_rwlock);
459 EXPORT_SYMBOL(lustre_hash_for_each_safe);
462 * For each hash bucket in the lustre hash @lh call the passed callback
463 * @func until all the hash buckets are empty. The passed callback @func
464 * or the previously registered callback lh->lh_put must remove the item
465 * from the hash. You may either use the lustre_hash_del() or hlist_del()
466 * functions. No rwlocks will be held during the callback @func it is
467 * safe to sleep if needed. This function will not terminate until the
468 * hash is empty. Note it is still possible to concurrently add new
469 * items in to the hash. It is the callers responsibility to ensure
470 * the required locking is in place to prevent concurrent insertions.
473 lustre_hash_for_each_empty(lustre_hash_t *lh, lh_for_each_cb func, void *data)
475 struct hlist_node *hnode;
476 lustre_hash_bucket_t *lhb;
482 read_lock(&lh->lh_rwlock);
483 lh_for_each_bucket(lh, lhb, i) {
484 write_lock(&lhb->lhb_rwlock);
485 while (!hlist_empty(&lhb->lhb_head)) {
486 hnode = lhb->lhb_head.first;
487 __lustre_hash_bucket_validate(lh, lhb, hnode);
488 obj = lh_get(lh, hnode);
489 write_unlock(&lhb->lhb_rwlock);
490 read_unlock(&lh->lh_rwlock);
492 (void)lh_put(lh, hnode);
495 write_unlock(&lhb->lhb_rwlock);
497 read_unlock(&lh->lh_rwlock);
500 EXPORT_SYMBOL(lustre_hash_for_each_empty);
503 * For each item in the lustre hash @lh which matches the @key call
504 * the passed callback @func and pass to it as an argument each hash
505 * item and the private @data. Before each callback ops->lh_get will
506 * be called, and after each callback ops->lh_put will be called.
507 * Finally, during the callback the bucket lock is held so the
508 * callback must never sleep.
511 lustre_hash_for_each_key(lustre_hash_t *lh, void *key,
512 lh_for_each_cb func, void *data)
514 struct hlist_node *hnode;
515 lustre_hash_bucket_t *lhb;
519 read_lock(&lh->lh_rwlock);
520 i = lh_hash(lh, key, lh->lh_cur_size - 1);
521 lhb = &lh->lh_buckets[i];
522 LASSERT(i < lh->lh_cur_size);
524 read_lock(&lhb->lhb_rwlock);
525 hlist_for_each(hnode, &(lhb->lhb_head)) {
526 __lustre_hash_bucket_validate(lh, lhb, hnode);
528 if (!lh_compare(lh, key, hnode))
531 func(lh_get(lh, hnode), data);
532 (void)lh_put(lh, hnode);
535 read_unlock(&lhb->lhb_rwlock);
536 read_unlock(&lh->lh_rwlock);
540 EXPORT_SYMBOL(lustre_hash_for_each_key);
543 * Rehash the lustre hash @lh to the given @size. This can be used
544 * to grow the hash size when excessive chaining is detected, or to
545 * shrink the hash when it is larger than needed. When the LH_REHASH
546 * flag is set in @lh the lustre hash may be dynamically rehashed
547 * during addition or removal if the hash's theta value exceeds
548 * either the lh->lh_min_theta or lh->max_theta values. By default
549 * these values are tuned to keep the chained hash depth small, and
550 * this approach assumes a reasonably uniform hashing function. The
551 * theta thresholds for @lh are tunable via lustre_hash_set_theta().
554 lustre_hash_rehash(lustre_hash_t *lh, int size)
556 struct hlist_node *hnode;
557 struct hlist_node *pos;
558 lustre_hash_bucket_t *lh_buckets;
559 lustre_hash_bucket_t *rehash_buckets;
560 lustre_hash_bucket_t *lh_lhb;
561 lustre_hash_bucket_t *rehash_lhb;
570 OBD_VMALLOC(rehash_buckets, sizeof(*rehash_buckets) * size);
574 for (i = 0; i < size; i++) {
575 INIT_HLIST_HEAD(&rehash_buckets[i].lhb_head);
576 rwlock_init(&rehash_buckets[i].lhb_rwlock);
577 atomic_set(&rehash_buckets[i].lhb_count, 0);
580 write_lock(&lh->lh_rwlock);
583 * Early return for multiple concurrent racing callers,
584 * ensure we only trigger the rehash if it is still needed.
586 theta = __lustre_hash_theta(lh);
587 if ((theta >= lh->lh_min_theta) && (theta <= lh->lh_max_theta)) {
588 OBD_VFREE(rehash_buckets, sizeof(*rehash_buckets) * size);
589 write_unlock(&lh->lh_rwlock);
593 lh_size = lh->lh_cur_size;
594 lh_buckets = lh->lh_buckets;
596 lh->lh_cur_size = size;
597 lh->lh_buckets = rehash_buckets;
598 atomic_inc(&lh->lh_rehash_count);
600 for (i = 0; i < lh_size; i++) {
601 lh_lhb = &lh_buckets[i];
603 write_lock(&lh_lhb->lhb_rwlock);
604 hlist_for_each_safe(hnode, pos, &(lh_lhb->lhb_head)) {
605 key = lh_key(lh, hnode);
609 * Validate hnode is in the correct bucket.
611 if (unlikely(lh->lh_flags & LH_DEBUG))
612 LASSERT(lh_hash(lh, key, lh_size - 1) == i);
615 * Delete from old hash bucket.
618 LASSERT(atomic_read(&lh_lhb->lhb_count) > 0);
619 atomic_dec(&lh_lhb->lhb_count);
622 * Add to rehash bucket, ops->lh_key must be defined.
624 rehash_lhb = &rehash_buckets[lh_hash(lh, key, size-1)];
625 hlist_add_head(hnode, &(rehash_lhb->lhb_head));
626 atomic_inc(&rehash_lhb->lhb_count);
629 LASSERT(hlist_empty(&(lh_lhb->lhb_head)));
630 LASSERT(atomic_read(&lh_lhb->lhb_count) == 0);
631 write_unlock(&lh_lhb->lhb_rwlock);
634 OBD_VFREE(lh_buckets, sizeof(*lh_buckets) * lh_size);
635 write_unlock(&lh->lh_rwlock);
639 EXPORT_SYMBOL(lustre_hash_rehash);
642 * Rehash the object referenced by @hnode in the lustre hash @lh. The
643 * @old_key must be provided to locate the objects previous location
644 * in the hash, and the @new_key will be used to reinsert the object.
645 * Use this function instead of a lustre_hash_add() + lustre_hash_del()
646 * combo when it is critical that there is no window in time where the
647 * object is missing from the hash. When an object is being rehashed
648 * the registered lh_get() and lh_put() functions will not be called.
650 void lustre_hash_rehash_key(lustre_hash_t *lh, void *old_key, void *new_key,
651 struct hlist_node *hnode)
653 lustre_hash_bucket_t *old_lhb;
654 lustre_hash_bucket_t *new_lhb;
659 __lustre_hash_key_validate(lh, new_key, hnode);
660 LASSERT(!hlist_unhashed(hnode));
662 read_lock(&lh->lh_rwlock);
664 i = lh_hash(lh, old_key, lh->lh_cur_size - 1);
665 old_lhb = &lh->lh_buckets[i];
666 LASSERT(i < lh->lh_cur_size);
668 j = lh_hash(lh, new_key, lh->lh_cur_size - 1);
669 new_lhb = &lh->lh_buckets[j];
670 LASSERT(j < lh->lh_cur_size);
672 write_lock(&old_lhb->lhb_rwlock);
673 write_lock(&new_lhb->lhb_rwlock);
676 * Migrate item between hash buckets without calling
677 * the lh_get() and lh_put() callback functions.
680 LASSERT(atomic_read(&old_lhb->lhb_count) > 0);
681 atomic_dec(&old_lhb->lhb_count);
682 hlist_add_head(hnode, &(new_lhb->lhb_head));
683 atomic_inc(&new_lhb->lhb_count);
685 write_unlock(&new_lhb->lhb_rwlock);
686 write_unlock(&old_lhb->lhb_rwlock);
687 read_unlock(&lh->lh_rwlock);
691 EXPORT_SYMBOL(lustre_hash_rehash_key);
693 int lustre_hash_debug_header(char *str, int size)
695 return snprintf(str, size,
696 "%-36s%6s%6s%6s%6s%6s%6s%6s%7s%6s%s\n",
697 "name", "cur", "min", "max", "theta", "t-min", "t-max",
698 "flags", "rehash", "count", " distribution");
700 EXPORT_SYMBOL(lustre_hash_debug_header);
702 int lustre_hash_debug_str(lustre_hash_t *lh, char *str, int size)
704 lustre_hash_bucket_t *lhb;
708 int dist[8] = { 0, };
710 if (str == NULL || size == 0)
713 read_lock(&lh->lh_rwlock);
714 theta = __lustre_hash_theta(lh);
716 c += snprintf(str + c, size - c, "%-36s ",lh->lh_name);
717 c += snprintf(str + c, size - c, "%5d ", lh->lh_cur_size);
718 c += snprintf(str + c, size - c, "%5d ", lh->lh_min_size);
719 c += snprintf(str + c, size - c, "%5d ", lh->lh_max_size);
720 c += snprintf(str + c, size - c, "%d.%03d ",
721 theta / 1000, theta % 1000);
722 c += snprintf(str + c, size - c, "%d.%03d ",
723 lh->lh_min_theta / 1000, lh->lh_min_theta % 1000);
724 c += snprintf(str + c, size - c, "%d.%03d ",
725 lh->lh_max_theta / 1000, lh->lh_max_theta % 1000);
726 c += snprintf(str + c, size - c, " 0x%02x ", lh->lh_flags);
727 c += snprintf(str + c, size - c, "%6d ",
728 atomic_read(&lh->lh_rehash_count));
729 c += snprintf(str + c, size - c, "%5d ",
730 atomic_read(&lh->lh_count));
733 * The distribution is a summary of the chained hash depth in
734 * each of the lustre hash buckets. Each buckets lhb_count is
735 * divided by the hash theta value and used to generate a
736 * histogram of the hash distribution. A uniform hash will
737 * result in all hash buckets being close to the average thus
738 * only the first few entries in the histogram will be non-zero.
739 * If you hash function results in a non-uniform hash the will
740 * be observable by outlier bucks in the distribution histogram.
742 * Uniform hash distribution: 128/128/0/0/0/0/0/0
743 * Non-Uniform hash distribution: 128/125/0/0/0/0/2/1
745 lh_for_each_bucket(lh, lhb, i)
746 dist[MIN(__fls(atomic_read(&lhb->lhb_count)/MAX(theta,1)),7)]++;
748 for (i = 0; i < 8; i++)
749 c += snprintf(str + c, size - c, "%d%c", dist[i],
750 (i == 7) ? '\n' : '/');
752 read_unlock(&lh->lh_rwlock);
756 EXPORT_SYMBOL(lustre_hash_debug_str);