lru_cache.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. lru_cache.c
  4. This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
  5. Copyright (C) 2003-2008, LINBIT Information Technologies GmbH.
  6. Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>.
  7. Copyright (C) 2003-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
  8. */
  9. #include <linux/module.h>
  10. #include <linux/bitops.h>
  11. #include <linux/slab.h>
  12. #include <linux/string.h> /* for memset */
  13. #include <linux/seq_file.h> /* for seq_printf */
  14. #include <linux/lru_cache.h>
  15. MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
  16. "Lars Ellenberg <lars@linbit.com>");
  17. MODULE_DESCRIPTION("lru_cache - Track sets of hot objects");
  18. MODULE_LICENSE("GPL");
  19. /* this is developers aid only.
  20. * it catches concurrent access (lack of locking on the users part) */
  21. #define PARANOIA_ENTRY() do { \
  22. BUG_ON(!lc); \
  23. BUG_ON(!lc->nr_elements); \
  24. BUG_ON(test_and_set_bit(__LC_PARANOIA, &lc->flags)); \
  25. } while (0)
  26. #define RETURN(x...) do { \
  27. clear_bit_unlock(__LC_PARANOIA, &lc->flags); \
  28. return x ; } while (0)
  29. /* BUG() if e is not one of the elements tracked by lc */
  30. #define PARANOIA_LC_ELEMENT(lc, e) do { \
  31. struct lru_cache *lc_ = (lc); \
  32. struct lc_element *e_ = (e); \
  33. unsigned i = e_->lc_index; \
  34. BUG_ON(i >= lc_->nr_elements); \
  35. BUG_ON(lc_->lc_element[i] != e_); } while (0)
  36. /* We need to atomically
  37. * - try to grab the lock (set LC_LOCKED)
  38. * - only if there is no pending transaction
  39. * (neither LC_DIRTY nor LC_STARVING is set)
  40. * Because of PARANOIA_ENTRY() above abusing lc->flags as well,
  41. * it is not sufficient to just say
  42. * return 0 == cmpxchg(&lc->flags, 0, LC_LOCKED);
  43. */
  44. int lc_try_lock(struct lru_cache *lc)
  45. {
  46. unsigned long val;
  47. do {
  48. val = cmpxchg(&lc->flags, 0, LC_LOCKED);
  49. } while (unlikely (val == LC_PARANOIA));
  50. /* Spin until no-one is inside a PARANOIA_ENTRY()/RETURN() section. */
  51. return 0 == val;
  52. }
  53. /**
  54. * lc_create - prepares to track objects in an active set
  55. * @name: descriptive name only used in lc_seq_printf_stats and lc_seq_dump_details
  56. * @cache: cache root pointer
  57. * @max_pending_changes: maximum changes to accumulate until a transaction is required
  58. * @e_count: number of elements allowed to be active simultaneously
  59. * @e_size: size of the tracked objects
  60. * @e_off: offset to the &struct lc_element member in a tracked object
  61. *
  62. * Returns a pointer to a newly initialized struct lru_cache on success,
  63. * or NULL on (allocation) failure.
  64. */
  65. struct lru_cache *lc_create(const char *name, struct kmem_cache *cache,
  66. unsigned max_pending_changes,
  67. unsigned e_count, size_t e_size, size_t e_off)
  68. {
  69. struct hlist_head *slot = NULL;
  70. struct lc_element **element = NULL;
  71. struct lru_cache *lc;
  72. struct lc_element *e;
  73. unsigned cache_obj_size = kmem_cache_size(cache);
  74. unsigned i;
  75. WARN_ON(cache_obj_size < e_size);
  76. if (cache_obj_size < e_size)
  77. return NULL;
  78. /* e_count too big; would probably fail the allocation below anyways.
  79. * for typical use cases, e_count should be few thousand at most. */
  80. if (e_count > LC_MAX_ACTIVE)
  81. return NULL;
  82. slot = kzalloc_objs(struct hlist_head, e_count);
  83. if (!slot)
  84. goto out_fail;
  85. element = kzalloc_objs(struct lc_element *, e_count);
  86. if (!element)
  87. goto out_fail;
  88. lc = kzalloc_obj(*lc);
  89. if (!lc)
  90. goto out_fail;
  91. INIT_LIST_HEAD(&lc->in_use);
  92. INIT_LIST_HEAD(&lc->lru);
  93. INIT_LIST_HEAD(&lc->free);
  94. INIT_LIST_HEAD(&lc->to_be_changed);
  95. lc->name = name;
  96. lc->element_size = e_size;
  97. lc->element_off = e_off;
  98. lc->nr_elements = e_count;
  99. lc->max_pending_changes = max_pending_changes;
  100. lc->lc_cache = cache;
  101. lc->lc_element = element;
  102. lc->lc_slot = slot;
  103. /* preallocate all objects */
  104. for (i = 0; i < e_count; i++) {
  105. void *p = kmem_cache_alloc(cache, GFP_KERNEL);
  106. if (!p)
  107. break;
  108. memset(p, 0, lc->element_size);
  109. e = p + e_off;
  110. e->lc_index = i;
  111. e->lc_number = LC_FREE;
  112. e->lc_new_number = LC_FREE;
  113. list_add(&e->list, &lc->free);
  114. element[i] = e;
  115. }
  116. if (i == e_count)
  117. return lc;
  118. /* else: could not allocate all elements, give up */
  119. while (i) {
  120. void *p = element[--i];
  121. kmem_cache_free(cache, p - e_off);
  122. }
  123. kfree(lc);
  124. out_fail:
  125. kfree(element);
  126. kfree(slot);
  127. return NULL;
  128. }
  129. static void lc_free_by_index(struct lru_cache *lc, unsigned i)
  130. {
  131. void *p = lc->lc_element[i];
  132. WARN_ON(!p);
  133. if (p) {
  134. p -= lc->element_off;
  135. kmem_cache_free(lc->lc_cache, p);
  136. }
  137. }
  138. /**
  139. * lc_destroy - frees memory allocated by lc_create()
  140. * @lc: the lru cache to destroy
  141. */
  142. void lc_destroy(struct lru_cache *lc)
  143. {
  144. unsigned i;
  145. if (!lc)
  146. return;
  147. for (i = 0; i < lc->nr_elements; i++)
  148. lc_free_by_index(lc, i);
  149. kfree(lc->lc_element);
  150. kfree(lc->lc_slot);
  151. kfree(lc);
  152. }
  153. /**
  154. * lc_reset - does a full reset for @lc and the hash table slots.
  155. * @lc: the lru cache to operate on
  156. *
  157. * It is roughly the equivalent of re-allocating a fresh lru_cache object,
  158. * basically a short cut to lc_destroy(lc); lc = lc_create(...);
  159. */
  160. void lc_reset(struct lru_cache *lc)
  161. {
  162. unsigned i;
  163. INIT_LIST_HEAD(&lc->in_use);
  164. INIT_LIST_HEAD(&lc->lru);
  165. INIT_LIST_HEAD(&lc->free);
  166. INIT_LIST_HEAD(&lc->to_be_changed);
  167. lc->used = 0;
  168. lc->hits = 0;
  169. lc->misses = 0;
  170. lc->starving = 0;
  171. lc->locked = 0;
  172. lc->changed = 0;
  173. lc->pending_changes = 0;
  174. lc->flags = 0;
  175. memset(lc->lc_slot, 0, sizeof(struct hlist_head) * lc->nr_elements);
  176. for (i = 0; i < lc->nr_elements; i++) {
  177. struct lc_element *e = lc->lc_element[i];
  178. void *p = e;
  179. p -= lc->element_off;
  180. memset(p, 0, lc->element_size);
  181. /* re-init it */
  182. e->lc_index = i;
  183. e->lc_number = LC_FREE;
  184. e->lc_new_number = LC_FREE;
  185. list_add(&e->list, &lc->free);
  186. }
  187. }
  188. /**
  189. * lc_seq_printf_stats - print stats about @lc into @seq
  190. * @seq: the seq_file to print into
  191. * @lc: the lru cache to print statistics of
  192. */
  193. void lc_seq_printf_stats(struct seq_file *seq, struct lru_cache *lc)
  194. {
  195. /* NOTE:
  196. * total calls to lc_get are
  197. * (starving + hits + misses)
  198. * misses include "locked" count (update from an other thread in
  199. * progress) and "changed", when this in fact lead to an successful
  200. * update of the cache.
  201. */
  202. seq_printf(seq, "\t%s: used:%u/%u hits:%lu misses:%lu starving:%lu locked:%lu changed:%lu\n",
  203. lc->name, lc->used, lc->nr_elements,
  204. lc->hits, lc->misses, lc->starving, lc->locked, lc->changed);
  205. }
  206. static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr)
  207. {
  208. return lc->lc_slot + (enr % lc->nr_elements);
  209. }
  210. static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr,
  211. bool include_changing)
  212. {
  213. struct lc_element *e;
  214. BUG_ON(!lc);
  215. BUG_ON(!lc->nr_elements);
  216. hlist_for_each_entry(e, lc_hash_slot(lc, enr), collision) {
  217. /* "about to be changed" elements, pending transaction commit,
  218. * are hashed by their "new number". "Normal" elements have
  219. * lc_number == lc_new_number. */
  220. if (e->lc_new_number != enr)
  221. continue;
  222. if (e->lc_new_number == e->lc_number || include_changing)
  223. return e;
  224. break;
  225. }
  226. return NULL;
  227. }
  228. /**
  229. * lc_find - find element by label, if present in the hash table
  230. * @lc: The lru_cache object
  231. * @enr: element number
  232. *
  233. * Returns the pointer to an element, if the element with the requested
  234. * "label" or element number is present in the hash table,
  235. * or NULL if not found. Does not change the refcnt.
  236. * Ignores elements that are "about to be used", i.e. not yet in the active
  237. * set, but still pending transaction commit.
  238. */
  239. struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr)
  240. {
  241. return __lc_find(lc, enr, 0);
  242. }
  243. /**
  244. * lc_is_used - find element by label
  245. * @lc: The lru_cache object
  246. * @enr: element number
  247. *
  248. * Returns true, if the element with the requested "label" or element number is
  249. * present in the hash table, and is used (refcnt > 0).
  250. * Also finds elements that are not _currently_ used but only "about to be
  251. * used", i.e. on the "to_be_changed" list, pending transaction commit.
  252. */
  253. bool lc_is_used(struct lru_cache *lc, unsigned int enr)
  254. {
  255. struct lc_element *e = __lc_find(lc, enr, 1);
  256. return e && e->refcnt;
  257. }
  258. /**
  259. * lc_del - removes an element from the cache
  260. * @lc: The lru_cache object
  261. * @e: The element to remove
  262. *
  263. * @e must be unused (refcnt == 0). Moves @e from "lru" to "free" list,
  264. * sets @e->enr to %LC_FREE.
  265. */
  266. void lc_del(struct lru_cache *lc, struct lc_element *e)
  267. {
  268. PARANOIA_ENTRY();
  269. PARANOIA_LC_ELEMENT(lc, e);
  270. BUG_ON(e->refcnt);
  271. e->lc_number = e->lc_new_number = LC_FREE;
  272. hlist_del_init(&e->collision);
  273. list_move(&e->list, &lc->free);
  274. RETURN();
  275. }
  276. static struct lc_element *lc_prepare_for_change(struct lru_cache *lc, unsigned new_number)
  277. {
  278. struct list_head *n;
  279. struct lc_element *e;
  280. if (!list_empty(&lc->free))
  281. n = lc->free.next;
  282. else if (!list_empty(&lc->lru))
  283. n = lc->lru.prev;
  284. else
  285. return NULL;
  286. e = list_entry(n, struct lc_element, list);
  287. PARANOIA_LC_ELEMENT(lc, e);
  288. e->lc_new_number = new_number;
  289. if (!hlist_unhashed(&e->collision))
  290. __hlist_del(&e->collision);
  291. hlist_add_head(&e->collision, lc_hash_slot(lc, new_number));
  292. list_move(&e->list, &lc->to_be_changed);
  293. return e;
  294. }
  295. static int lc_unused_element_available(struct lru_cache *lc)
  296. {
  297. if (!list_empty(&lc->free))
  298. return 1; /* something on the free list */
  299. if (!list_empty(&lc->lru))
  300. return 1; /* something to evict */
  301. return 0;
  302. }
  303. /* used as internal flags to __lc_get */
  304. enum {
  305. LC_GET_MAY_CHANGE = 1,
  306. LC_GET_MAY_USE_UNCOMMITTED = 2,
  307. };
  308. static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags)
  309. {
  310. struct lc_element *e;
  311. PARANOIA_ENTRY();
  312. if (test_bit(__LC_STARVING, &lc->flags)) {
  313. ++lc->starving;
  314. RETURN(NULL);
  315. }
  316. e = __lc_find(lc, enr, 1);
  317. /* if lc_new_number != lc_number,
  318. * this enr is currently being pulled in already,
  319. * and will be available once the pending transaction
  320. * has been committed. */
  321. if (e) {
  322. if (e->lc_new_number != e->lc_number) {
  323. /* It has been found above, but on the "to_be_changed"
  324. * list, not yet committed. Don't pull it in twice,
  325. * wait for the transaction, then try again...
  326. */
  327. if (!(flags & LC_GET_MAY_USE_UNCOMMITTED))
  328. RETURN(NULL);
  329. /* ... unless the caller is aware of the implications,
  330. * probably preparing a cumulative transaction. */
  331. ++e->refcnt;
  332. ++lc->hits;
  333. RETURN(e);
  334. }
  335. /* else: lc_new_number == lc_number; a real hit. */
  336. ++lc->hits;
  337. if (e->refcnt++ == 0)
  338. lc->used++;
  339. list_move(&e->list, &lc->in_use); /* Not evictable... */
  340. RETURN(e);
  341. }
  342. /* e == NULL */
  343. ++lc->misses;
  344. if (!(flags & LC_GET_MAY_CHANGE))
  345. RETURN(NULL);
  346. /* To avoid races with lc_try_lock(), first, mark us dirty
  347. * (using test_and_set_bit, as it implies memory barriers), ... */
  348. test_and_set_bit(__LC_DIRTY, &lc->flags);
  349. /* ... only then check if it is locked anyways. If lc_unlock clears
  350. * the dirty bit again, that's not a problem, we will come here again.
  351. */
  352. if (test_bit(__LC_LOCKED, &lc->flags)) {
  353. ++lc->locked;
  354. RETURN(NULL);
  355. }
  356. /* In case there is nothing available and we can not kick out
  357. * the LRU element, we have to wait ...
  358. */
  359. if (!lc_unused_element_available(lc)) {
  360. set_bit(__LC_STARVING, &lc->flags);
  361. RETURN(NULL);
  362. }
  363. /* It was not present in the active set. We are going to recycle an
  364. * unused (or even "free") element, but we won't accumulate more than
  365. * max_pending_changes changes. */
  366. if (lc->pending_changes >= lc->max_pending_changes)
  367. RETURN(NULL);
  368. e = lc_prepare_for_change(lc, enr);
  369. BUG_ON(!e);
  370. clear_bit(__LC_STARVING, &lc->flags);
  371. BUG_ON(++e->refcnt != 1);
  372. lc->used++;
  373. lc->pending_changes++;
  374. RETURN(e);
  375. }
  376. /**
  377. * lc_get - get element by label, maybe change the active set
  378. * @lc: the lru cache to operate on
  379. * @enr: the label to look up
  380. *
  381. * Finds an element in the cache, increases its usage count,
  382. * "touches" and returns it.
  383. *
  384. * In case the requested number is not present, it needs to be added to the
  385. * cache. Therefore it is possible that an other element becomes evicted from
  386. * the cache. In either case, the user is notified so he is able to e.g. keep
  387. * a persistent log of the cache changes, and therefore the objects in use.
  388. *
  389. * Return values:
  390. * NULL
  391. * The cache was marked %LC_STARVING,
  392. * or the requested label was not in the active set
  393. * and a changing transaction is still pending (@lc was marked %LC_DIRTY).
  394. * Or no unused or free element could be recycled (@lc will be marked as
  395. * %LC_STARVING, blocking further lc_get() operations).
  396. *
  397. * pointer to the element with the REQUESTED element number.
  398. * In this case, it can be used right away
  399. *
  400. * pointer to an UNUSED element with some different element number,
  401. * where that different number may also be %LC_FREE.
  402. *
  403. * In this case, the cache is marked %LC_DIRTY,
  404. * so lc_try_lock() will no longer succeed.
  405. * The returned element pointer is moved to the "to_be_changed" list,
  406. * and registered with the new element number on the hash collision chains,
  407. * so it is possible to pick it up from lc_is_used().
  408. * Up to "max_pending_changes" (see lc_create()) can be accumulated.
  409. * The user now should do whatever housekeeping is necessary,
  410. * typically serialize on lc_try_lock_for_transaction(), then call
  411. * lc_committed(lc) and lc_unlock(), to finish the change.
  412. *
  413. * NOTE: The user needs to check the lc_number on EACH use, so he recognizes
  414. * any cache set change.
  415. */
  416. struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr)
  417. {
  418. return __lc_get(lc, enr, LC_GET_MAY_CHANGE);
  419. }
  420. /**
  421. * lc_get_cumulative - like lc_get; also finds to-be-changed elements
  422. * @lc: the lru cache to operate on
  423. * @enr: the label to look up
  424. *
  425. * Unlike lc_get this also returns the element for @enr, if it is belonging to
  426. * a pending transaction, so the return values are like for lc_get(),
  427. * plus:
  428. *
  429. * pointer to an element already on the "to_be_changed" list.
  430. * In this case, the cache was already marked %LC_DIRTY.
  431. *
  432. * Caller needs to make sure that the pending transaction is completed,
  433. * before proceeding to actually use this element.
  434. */
  435. struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr)
  436. {
  437. return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED);
  438. }
  439. /**
  440. * lc_try_get - get element by label, if present; do not change the active set
  441. * @lc: the lru cache to operate on
  442. * @enr: the label to look up
  443. *
  444. * Finds an element in the cache, increases its usage count,
  445. * "touches" and returns it.
  446. *
  447. * Return values:
  448. * NULL
  449. * The cache was marked %LC_STARVING,
  450. * or the requested label was not in the active set
  451. *
  452. * pointer to the element with the REQUESTED element number.
  453. * In this case, it can be used right away
  454. */
  455. struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr)
  456. {
  457. return __lc_get(lc, enr, 0);
  458. }
  459. /**
  460. * lc_committed - tell @lc that pending changes have been recorded
  461. * @lc: the lru cache to operate on
  462. *
  463. * User is expected to serialize on explicit lc_try_lock_for_transaction()
  464. * before the transaction is started, and later needs to lc_unlock() explicitly
  465. * as well.
  466. */
  467. void lc_committed(struct lru_cache *lc)
  468. {
  469. struct lc_element *e, *tmp;
  470. PARANOIA_ENTRY();
  471. list_for_each_entry_safe(e, tmp, &lc->to_be_changed, list) {
  472. /* count number of changes, not number of transactions */
  473. ++lc->changed;
  474. e->lc_number = e->lc_new_number;
  475. list_move(&e->list, &lc->in_use);
  476. }
  477. lc->pending_changes = 0;
  478. RETURN();
  479. }
  480. /**
  481. * lc_put - give up refcnt of @e
  482. * @lc: the lru cache to operate on
  483. * @e: the element to put
  484. *
  485. * If refcnt reaches zero, the element is moved to the lru list,
  486. * and a %LC_STARVING (if set) is cleared.
  487. * Returns the new (post-decrement) refcnt.
  488. */
  489. unsigned int lc_put(struct lru_cache *lc, struct lc_element *e)
  490. {
  491. PARANOIA_ENTRY();
  492. PARANOIA_LC_ELEMENT(lc, e);
  493. BUG_ON(e->refcnt == 0);
  494. BUG_ON(e->lc_number != e->lc_new_number);
  495. if (--e->refcnt == 0) {
  496. /* move it to the front of LRU. */
  497. list_move(&e->list, &lc->lru);
  498. lc->used--;
  499. clear_bit_unlock(__LC_STARVING, &lc->flags);
  500. }
  501. RETURN(e->refcnt);
  502. }
  503. /**
  504. * lc_element_by_index
  505. * @lc: the lru cache to operate on
  506. * @i: the index of the element to return
  507. */
  508. struct lc_element *lc_element_by_index(struct lru_cache *lc, unsigned i)
  509. {
  510. BUG_ON(i >= lc->nr_elements);
  511. BUG_ON(lc->lc_element[i] == NULL);
  512. BUG_ON(lc->lc_element[i]->lc_index != i);
  513. return lc->lc_element[i];
  514. }
  515. /**
  516. * lc_seq_dump_details - Dump a complete LRU cache to seq in textual form.
  517. * @lc: the lru cache to operate on
  518. * @seq: the &struct seq_file pointer to seq_printf into
  519. * @utext: user supplied additional "heading" or other info
  520. * @detail: function pointer the user may provide to dump further details
  521. * of the object the lc_element is embedded in. May be NULL.
  522. * Note: a leading space ' ' and trailing newline '\n' is implied.
  523. */
  524. void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext,
  525. void (*detail) (struct seq_file *, struct lc_element *))
  526. {
  527. unsigned int nr_elements = lc->nr_elements;
  528. struct lc_element *e;
  529. int i;
  530. seq_printf(seq, "\tnn: lc_number (new nr) refcnt %s\n ", utext);
  531. for (i = 0; i < nr_elements; i++) {
  532. e = lc_element_by_index(lc, i);
  533. if (e->lc_number != e->lc_new_number)
  534. seq_printf(seq, "\t%5d: %6d %8d %6d ",
  535. i, e->lc_number, e->lc_new_number, e->refcnt);
  536. else
  537. seq_printf(seq, "\t%5d: %6d %-8s %6d ",
  538. i, e->lc_number, "-\"-", e->refcnt);
  539. if (detail)
  540. detail(seq, e);
  541. seq_putc(seq, '\n');
  542. }
  543. }
  544. EXPORT_SYMBOL(lc_create);
  545. EXPORT_SYMBOL(lc_reset);
  546. EXPORT_SYMBOL(lc_destroy);
  547. EXPORT_SYMBOL(lc_del);
  548. EXPORT_SYMBOL(lc_try_get);
  549. EXPORT_SYMBOL(lc_find);
  550. EXPORT_SYMBOL(lc_get);
  551. EXPORT_SYMBOL(lc_put);
  552. EXPORT_SYMBOL(lc_committed);
  553. EXPORT_SYMBOL(lc_element_by_index);
  554. EXPORT_SYMBOL(lc_seq_printf_stats);
  555. EXPORT_SYMBOL(lc_seq_dump_details);
  556. EXPORT_SYMBOL(lc_try_lock);
  557. EXPORT_SYMBOL(lc_is_used);
  558. EXPORT_SYMBOL(lc_get_cumulative);