mbcache.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. /*
  2. * linux/fs/mbcache.c
  3. * (C) 2001-2002 Andreas Gruenbacher, <a.gruenbacher@computer.org>
  4. */
  5. /*
  6. * Filesystem Meta Information Block Cache (mbcache)
  7. *
  8. * The mbcache caches blocks of block devices that need to be located
  9. * by their device/block number, as well as by other criteria (such
  10. * as the block's contents).
  11. *
  12. * There can only be one cache entry in a cache per device and block number.
  13. * Additional indexes need not be unique in this sense. The number of
  14. * additional indexes (=other criteria) can be hardwired at compile time
  15. * or specified at cache create time.
  16. *
  17. * Each cache entry is of fixed size. An entry may be `valid' or `invalid'
  18. * in the cache. A valid entry is in the main hash tables of the cache,
  19. * and may also be in the lru list. An invalid entry is not in any hashes
  20. * or lists.
  21. *
  22. * A valid cache entry is only in the lru list if no handles refer to it.
  23. * Invalid cache entries will be freed when the last handle to the cache
  24. * entry is released. Entries that cannot be freed immediately are put
  25. * back on the lru list.
  26. */
  27. #include <linux/kernel.h>
  28. #include <linux/module.h>
  29. #include <linux/hash.h>
  30. #include <linux/fs.h>
  31. #include <linux/mm.h>
  32. #include <linux/slab.h>
  33. #include <linux/sched.h>
  34. #include <linux/init.h>
  35. #include <linux/mbcache.h>
  36. #ifdef MB_CACHE_DEBUG
  37. # define mb_debug(f...) do { \
  38. printk(KERN_DEBUG f); \
  39. printk("\n"); \
  40. } while (0)
  41. #define mb_assert(c) do { if (!(c)) \
  42. printk(KERN_ERR "assertion " #c " failed\n"); \
  43. } while(0)
  44. #else
  45. # define mb_debug(f...) do { } while(0)
  46. # define mb_assert(c) do { } while(0)
  47. #endif
  48. #define mb_error(f...) do { \
  49. printk(KERN_ERR f); \
  50. printk("\n"); \
  51. } while(0)
  52. #define MB_CACHE_WRITER ((unsigned short)~0U >> 1)
  53. static DECLARE_WAIT_QUEUE_HEAD(mb_cache_queue);
  54. MODULE_AUTHOR("Andreas Gruenbacher <a.gruenbacher@computer.org>");
  55. MODULE_DESCRIPTION("Meta block cache (for extended attributes)");
  56. MODULE_LICENSE("GPL");
  57. EXPORT_SYMBOL(mb_cache_create);
  58. EXPORT_SYMBOL(mb_cache_shrink);
  59. EXPORT_SYMBOL(mb_cache_destroy);
  60. EXPORT_SYMBOL(mb_cache_entry_alloc);
  61. EXPORT_SYMBOL(mb_cache_entry_insert);
  62. EXPORT_SYMBOL(mb_cache_entry_release);
  63. EXPORT_SYMBOL(mb_cache_entry_free);
  64. EXPORT_SYMBOL(mb_cache_entry_get);
  65. #if !defined(MB_CACHE_INDEXES_COUNT) || (MB_CACHE_INDEXES_COUNT > 0)
  66. EXPORT_SYMBOL(mb_cache_entry_find_first);
  67. EXPORT_SYMBOL(mb_cache_entry_find_next);
  68. #endif
  69. /*
  70. * Global data: list of all mbcache's, lru list, and a spinlock for
  71. * accessing cache data structures on SMP machines. The lru list is
  72. * global across all mbcaches.
  73. */
  74. static LIST_HEAD(mb_cache_list);
  75. static LIST_HEAD(mb_cache_lru_list);
  76. static DEFINE_SPINLOCK(mb_cache_spinlock);
  77. /*
  78. * What the mbcache registers as to get shrunk dynamically.
  79. */
  80. static int mb_cache_shrink_fn(struct shrinker *shrink,
  81. struct shrink_control *sc);
  82. static struct shrinker mb_cache_shrinker = {
  83. .shrink = mb_cache_shrink_fn,
  84. .seeks = DEFAULT_SEEKS,
  85. };
  86. static inline int
  87. __mb_cache_entry_is_hashed(struct mb_cache_entry *ce)
  88. {
  89. return !list_empty(&ce->e_block_list);
  90. }
  91. static void
  92. __mb_cache_entry_unhash(struct mb_cache_entry *ce)
  93. {
  94. if (__mb_cache_entry_is_hashed(ce)) {
  95. list_del_init(&ce->e_block_list);
  96. list_del(&ce->e_index.o_list);
  97. }
  98. }
  99. static void
  100. __mb_cache_entry_forget(struct mb_cache_entry *ce, gfp_t gfp_mask)
  101. {
  102. struct mb_cache *cache = ce->e_cache;
  103. mb_assert(!(ce->e_used || ce->e_queued));
  104. kmem_cache_free(cache->c_entry_cache, ce);
  105. atomic_dec(&cache->c_entry_count);
  106. }
  107. static void
  108. __mb_cache_entry_release_unlock(struct mb_cache_entry *ce)
  109. __releases(mb_cache_spinlock)
  110. {
  111. /* Wake up all processes queuing for this cache entry. */
  112. if (ce->e_queued)
  113. wake_up_all(&mb_cache_queue);
  114. if (ce->e_used >= MB_CACHE_WRITER)
  115. ce->e_used -= MB_CACHE_WRITER;
  116. ce->e_used--;
  117. if (!(ce->e_used || ce->e_queued)) {
  118. if (!__mb_cache_entry_is_hashed(ce))
  119. goto forget;
  120. mb_assert(list_empty(&ce->e_lru_list));
  121. list_add_tail(&ce->e_lru_list, &mb_cache_lru_list);
  122. }
  123. spin_unlock(&mb_cache_spinlock);
  124. return;
  125. forget:
  126. spin_unlock(&mb_cache_spinlock);
  127. __mb_cache_entry_forget(ce, GFP_KERNEL);
  128. }
  129. /*
  130. * mb_cache_shrink_fn() memory pressure callback
  131. *
  132. * This function is called by the kernel memory management when memory
  133. * gets low.
  134. *
  135. * @shrink: (ignored)
  136. * @sc: shrink_control passed from reclaim
  137. *
  138. * Returns the number of objects which are present in the cache.
  139. */
  140. static int
  141. mb_cache_shrink_fn(struct shrinker *shrink, struct shrink_control *sc)
  142. {
  143. LIST_HEAD(free_list);
  144. struct mb_cache *cache;
  145. struct mb_cache_entry *entry, *tmp;
  146. int count = 0;
  147. int nr_to_scan = sc->nr_to_scan;
  148. gfp_t gfp_mask = sc->gfp_mask;
  149. mb_debug("trying to free %d entries", nr_to_scan);
  150. spin_lock(&mb_cache_spinlock);
  151. while (nr_to_scan-- && !list_empty(&mb_cache_lru_list)) {
  152. struct mb_cache_entry *ce =
  153. list_entry(mb_cache_lru_list.next,
  154. struct mb_cache_entry, e_lru_list);
  155. list_move_tail(&ce->e_lru_list, &free_list);
  156. __mb_cache_entry_unhash(ce);
  157. }
  158. list_for_each_entry(cache, &mb_cache_list, c_cache_list) {
  159. mb_debug("cache %s (%d)", cache->c_name,
  160. atomic_read(&cache->c_entry_count));
  161. count += atomic_read(&cache->c_entry_count);
  162. }
  163. spin_unlock(&mb_cache_spinlock);
  164. list_for_each_entry_safe(entry, tmp, &free_list, e_lru_list) {
  165. __mb_cache_entry_forget(entry, gfp_mask);
  166. }
  167. return vfs_pressure_ratio(count);
  168. }
  169. /*
  170. * mb_cache_create() create a new cache
  171. *
  172. * All entries in one cache are equal size. Cache entries may be from
  173. * multiple devices. If this is the first mbcache created, registers
  174. * the cache with kernel memory management. Returns NULL if no more
  175. * memory was available.
  176. *
  177. * @name: name of the cache (informal)
  178. * @bucket_bits: log2(number of hash buckets)
  179. */
  180. struct mb_cache *
  181. mb_cache_create(const char *name, int bucket_bits)
  182. {
  183. int n, bucket_count = 1 << bucket_bits;
  184. struct mb_cache *cache = NULL;
  185. cache = kmalloc(sizeof(struct mb_cache), GFP_KERNEL);
  186. if (!cache)
  187. return NULL;
  188. cache->c_name = name;
  189. atomic_set(&cache->c_entry_count, 0);
  190. cache->c_bucket_bits = bucket_bits;
  191. cache->c_block_hash = kmalloc(bucket_count * sizeof(struct list_head),
  192. GFP_KERNEL);
  193. if (!cache->c_block_hash)
  194. goto fail;
  195. for (n=0; n<bucket_count; n++)
  196. INIT_LIST_HEAD(&cache->c_block_hash[n]);
  197. cache->c_index_hash = kmalloc(bucket_count * sizeof(struct list_head),
  198. GFP_KERNEL);
  199. if (!cache->c_index_hash)
  200. goto fail;
  201. for (n=0; n<bucket_count; n++)
  202. INIT_LIST_HEAD(&cache->c_index_hash[n]);
  203. cache->c_entry_cache = kmem_cache_create(name,
  204. sizeof(struct mb_cache_entry), 0,
  205. SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL);
  206. if (!cache->c_entry_cache)
  207. goto fail2;
  208. /*
  209. * Set an upper limit on the number of cache entries so that the hash
  210. * chains won't grow too long.
  211. */
  212. cache->c_max_entries = bucket_count << 4;
  213. spin_lock(&mb_cache_spinlock);
  214. list_add(&cache->c_cache_list, &mb_cache_list);
  215. spin_unlock(&mb_cache_spinlock);
  216. return cache;
  217. fail2:
  218. kfree(cache->c_index_hash);
  219. fail:
  220. kfree(cache->c_block_hash);
  221. kfree(cache);
  222. return NULL;
  223. }
  224. /*
  225. * mb_cache_shrink()
  226. *
  227. * Removes all cache entries of a device from the cache. All cache entries
  228. * currently in use cannot be freed, and thus remain in the cache. All others
  229. * are freed.
  230. *
  231. * @bdev: which device's cache entries to shrink
  232. */
  233. void
  234. mb_cache_shrink(struct block_device *bdev)
  235. {
  236. LIST_HEAD(free_list);
  237. struct list_head *l, *ltmp;
  238. spin_lock(&mb_cache_spinlock);
  239. list_for_each_safe(l, ltmp, &mb_cache_lru_list) {
  240. struct mb_cache_entry *ce =
  241. list_entry(l, struct mb_cache_entry, e_lru_list);
  242. if (ce->e_bdev == bdev) {
  243. list_move_tail(&ce->e_lru_list, &free_list);
  244. __mb_cache_entry_unhash(ce);
  245. }
  246. }
  247. spin_unlock(&mb_cache_spinlock);
  248. list_for_each_safe(l, ltmp, &free_list) {
  249. __mb_cache_entry_forget(list_entry(l, struct mb_cache_entry,
  250. e_lru_list), GFP_KERNEL);
  251. }
  252. }
  253. /*
  254. * mb_cache_destroy()
  255. *
  256. * Shrinks the cache to its minimum possible size (hopefully 0 entries),
  257. * and then destroys it. If this was the last mbcache, un-registers the
  258. * mbcache from kernel memory management.
  259. */
  260. void
  261. mb_cache_destroy(struct mb_cache *cache)
  262. {
  263. LIST_HEAD(free_list);
  264. struct list_head *l, *ltmp;
  265. spin_lock(&mb_cache_spinlock);
  266. list_for_each_safe(l, ltmp, &mb_cache_lru_list) {
  267. struct mb_cache_entry *ce =
  268. list_entry(l, struct mb_cache_entry, e_lru_list);
  269. if (ce->e_cache == cache) {
  270. list_move_tail(&ce->e_lru_list, &free_list);
  271. __mb_cache_entry_unhash(ce);
  272. }
  273. }
  274. list_del(&cache->c_cache_list);
  275. spin_unlock(&mb_cache_spinlock);
  276. list_for_each_safe(l, ltmp, &free_list) {
  277. __mb_cache_entry_forget(list_entry(l, struct mb_cache_entry,
  278. e_lru_list), GFP_KERNEL);
  279. }
  280. if (atomic_read(&cache->c_entry_count) > 0) {
  281. mb_error("cache %s: %d orphaned entries",
  282. cache->c_name,
  283. atomic_read(&cache->c_entry_count));
  284. }
  285. kmem_cache_destroy(cache->c_entry_cache);
  286. kfree(cache->c_index_hash);
  287. kfree(cache->c_block_hash);
  288. kfree(cache);
  289. }
  290. /*
  291. * mb_cache_entry_alloc()
  292. *
  293. * Allocates a new cache entry. The new entry will not be valid initially,
  294. * and thus cannot be looked up yet. It should be filled with data, and
  295. * then inserted into the cache using mb_cache_entry_insert(). Returns NULL
  296. * if no more memory was available.
  297. */
  298. struct mb_cache_entry *
  299. mb_cache_entry_alloc(struct mb_cache *cache, gfp_t gfp_flags)
  300. {
  301. struct mb_cache_entry *ce = NULL;
  302. if (atomic_read(&cache->c_entry_count) >= cache->c_max_entries) {
  303. spin_lock(&mb_cache_spinlock);
  304. if (!list_empty(&mb_cache_lru_list)) {
  305. ce = list_entry(mb_cache_lru_list.next,
  306. struct mb_cache_entry, e_lru_list);
  307. list_del_init(&ce->e_lru_list);
  308. __mb_cache_entry_unhash(ce);
  309. }
  310. spin_unlock(&mb_cache_spinlock);
  311. }
  312. if (!ce) {
  313. ce = kmem_cache_alloc(cache->c_entry_cache, gfp_flags);
  314. if (!ce)
  315. return NULL;
  316. atomic_inc(&cache->c_entry_count);
  317. INIT_LIST_HEAD(&ce->e_lru_list);
  318. INIT_LIST_HEAD(&ce->e_block_list);
  319. ce->e_cache = cache;
  320. ce->e_queued = 0;
  321. }
  322. ce->e_used = 1 + MB_CACHE_WRITER;
  323. return ce;
  324. }
  325. /*
  326. * mb_cache_entry_insert()
  327. *
  328. * Inserts an entry that was allocated using mb_cache_entry_alloc() into
  329. * the cache. After this, the cache entry can be looked up, but is not yet
  330. * in the lru list as the caller still holds a handle to it. Returns 0 on
  331. * success, or -EBUSY if a cache entry for that device + inode exists
  332. * already (this may happen after a failed lookup, but when another process
  333. * has inserted the same cache entry in the meantime).
  334. *
  335. * @bdev: device the cache entry belongs to
  336. * @block: block number
  337. * @key: lookup key
  338. */
  339. int
  340. mb_cache_entry_insert(struct mb_cache_entry *ce, struct block_device *bdev,
  341. sector_t block, unsigned int key)
  342. {
  343. struct mb_cache *cache = ce->e_cache;
  344. unsigned int bucket;
  345. struct list_head *l;
  346. int error = -EBUSY;
  347. bucket = hash_long((unsigned long)bdev + (block & 0xffffffff),
  348. cache->c_bucket_bits);
  349. spin_lock(&mb_cache_spinlock);
  350. list_for_each_prev(l, &cache->c_block_hash[bucket]) {
  351. struct mb_cache_entry *ce =
  352. list_entry(l, struct mb_cache_entry, e_block_list);
  353. if (ce->e_bdev == bdev && ce->e_block == block)
  354. goto out;
  355. }
  356. __mb_cache_entry_unhash(ce);
  357. ce->e_bdev = bdev;
  358. ce->e_block = block;
  359. list_add(&ce->e_block_list, &cache->c_block_hash[bucket]);
  360. ce->e_index.o_key = key;
  361. bucket = hash_long(key, cache->c_bucket_bits);
  362. list_add(&ce->e_index.o_list, &cache->c_index_hash[bucket]);
  363. error = 0;
  364. out:
  365. spin_unlock(&mb_cache_spinlock);
  366. return error;
  367. }
  368. /*
  369. * mb_cache_entry_release()
  370. *
  371. * Release a handle to a cache entry. When the last handle to a cache entry
  372. * is released it is either freed (if it is invalid) or otherwise inserted
  373. * in to the lru list.
  374. */
  375. void
  376. mb_cache_entry_release(struct mb_cache_entry *ce)
  377. {
  378. spin_lock(&mb_cache_spinlock);
  379. __mb_cache_entry_release_unlock(ce);
  380. }
  381. /*
  382. * mb_cache_entry_free()
  383. *
  384. * This is equivalent to the sequence mb_cache_entry_takeout() --
  385. * mb_cache_entry_release().
  386. */
  387. void
  388. mb_cache_entry_free(struct mb_cache_entry *ce)
  389. {
  390. spin_lock(&mb_cache_spinlock);
  391. mb_assert(list_empty(&ce->e_lru_list));
  392. __mb_cache_entry_unhash(ce);
  393. __mb_cache_entry_release_unlock(ce);
  394. }
  395. /*
  396. * mb_cache_entry_get()
  397. *
  398. * Get a cache entry by device / block number. (There can only be one entry
  399. * in the cache per device and block.) Returns NULL if no such cache entry
  400. * exists. The returned cache entry is locked for exclusive access ("single
  401. * writer").
  402. */
  403. struct mb_cache_entry *
  404. mb_cache_entry_get(struct mb_cache *cache, struct block_device *bdev,
  405. sector_t block)
  406. {
  407. unsigned int bucket;
  408. struct list_head *l;
  409. struct mb_cache_entry *ce;
  410. bucket = hash_long((unsigned long)bdev + (block & 0xffffffff),
  411. cache->c_bucket_bits);
  412. spin_lock(&mb_cache_spinlock);
  413. list_for_each(l, &cache->c_block_hash[bucket]) {
  414. ce = list_entry(l, struct mb_cache_entry, e_block_list);
  415. if (ce->e_bdev == bdev && ce->e_block == block) {
  416. DEFINE_WAIT(wait);
  417. if (!list_empty(&ce->e_lru_list))
  418. list_del_init(&ce->e_lru_list);
  419. while (ce->e_used > 0) {
  420. ce->e_queued++;
  421. prepare_to_wait(&mb_cache_queue, &wait,
  422. TASK_UNINTERRUPTIBLE);
  423. spin_unlock(&mb_cache_spinlock);
  424. schedule();
  425. spin_lock(&mb_cache_spinlock);
  426. ce->e_queued--;
  427. }
  428. finish_wait(&mb_cache_queue, &wait);
  429. ce->e_used += 1 + MB_CACHE_WRITER;
  430. if (!__mb_cache_entry_is_hashed(ce)) {
  431. __mb_cache_entry_release_unlock(ce);
  432. return NULL;
  433. }
  434. goto cleanup;
  435. }
  436. }
  437. ce = NULL;
  438. cleanup:
  439. spin_unlock(&mb_cache_spinlock);
  440. return ce;
  441. }
  442. #if !defined(MB_CACHE_INDEXES_COUNT) || (MB_CACHE_INDEXES_COUNT > 0)
  443. static struct mb_cache_entry *
  444. __mb_cache_entry_find(struct list_head *l, struct list_head *head,
  445. struct block_device *bdev, unsigned int key)
  446. {
  447. while (l != head) {
  448. struct mb_cache_entry *ce =
  449. list_entry(l, struct mb_cache_entry, e_index.o_list);
  450. if (ce->e_bdev == bdev && ce->e_index.o_key == key) {
  451. DEFINE_WAIT(wait);
  452. if (!list_empty(&ce->e_lru_list))
  453. list_del_init(&ce->e_lru_list);
  454. /* Incrementing before holding the lock gives readers
  455. priority over writers. */
  456. ce->e_used++;
  457. while (ce->e_used >= MB_CACHE_WRITER) {
  458. ce->e_queued++;
  459. prepare_to_wait(&mb_cache_queue, &wait,
  460. TASK_UNINTERRUPTIBLE);
  461. spin_unlock(&mb_cache_spinlock);
  462. schedule();
  463. spin_lock(&mb_cache_spinlock);
  464. ce->e_queued--;
  465. }
  466. finish_wait(&mb_cache_queue, &wait);
  467. if (!__mb_cache_entry_is_hashed(ce)) {
  468. __mb_cache_entry_release_unlock(ce);
  469. spin_lock(&mb_cache_spinlock);
  470. return ERR_PTR(-EAGAIN);
  471. }
  472. return ce;
  473. }
  474. l = l->next;
  475. }
  476. return NULL;
  477. }
  478. /*
  479. * mb_cache_entry_find_first()
  480. *
  481. * Find the first cache entry on a given device with a certain key in
  482. * an additional index. Additional matches can be found with
  483. * mb_cache_entry_find_next(). Returns NULL if no match was found. The
  484. * returned cache entry is locked for shared access ("multiple readers").
  485. *
  486. * @cache: the cache to search
  487. * @bdev: the device the cache entry should belong to
  488. * @key: the key in the index
  489. */
  490. struct mb_cache_entry *
  491. mb_cache_entry_find_first(struct mb_cache *cache, struct block_device *bdev,
  492. unsigned int key)
  493. {
  494. unsigned int bucket = hash_long(key, cache->c_bucket_bits);
  495. struct list_head *l;
  496. struct mb_cache_entry *ce;
  497. spin_lock(&mb_cache_spinlock);
  498. l = cache->c_index_hash[bucket].next;
  499. ce = __mb_cache_entry_find(l, &cache->c_index_hash[bucket], bdev, key);
  500. spin_unlock(&mb_cache_spinlock);
  501. return ce;
  502. }
  503. /*
  504. * mb_cache_entry_find_next()
  505. *
  506. * Find the next cache entry on a given device with a certain key in an
  507. * additional index. Returns NULL if no match could be found. The previous
  508. * entry is atomatically released, so that mb_cache_entry_find_next() can
  509. * be called like this:
  510. *
  511. * entry = mb_cache_entry_find_first();
  512. * while (entry) {
  513. * ...
  514. * entry = mb_cache_entry_find_next(entry, ...);
  515. * }
  516. *
  517. * @prev: The previous match
  518. * @bdev: the device the cache entry should belong to
  519. * @key: the key in the index
  520. */
  521. struct mb_cache_entry *
  522. mb_cache_entry_find_next(struct mb_cache_entry *prev,
  523. struct block_device *bdev, unsigned int key)
  524. {
  525. struct mb_cache *cache = prev->e_cache;
  526. unsigned int bucket = hash_long(key, cache->c_bucket_bits);
  527. struct list_head *l;
  528. struct mb_cache_entry *ce;
  529. spin_lock(&mb_cache_spinlock);
  530. l = prev->e_index.o_list.next;
  531. ce = __mb_cache_entry_find(l, &cache->c_index_hash[bucket], bdev, key);
  532. __mb_cache_entry_release_unlock(prev);
  533. return ce;
  534. }
  535. #endif /* !defined(MB_CACHE_INDEXES_COUNT) || (MB_CACHE_INDEXES_COUNT > 0) */
  536. static int __init init_mbcache(void)
  537. {
  538. register_shrinker(&mb_cache_shrinker);
  539. return 0;
  540. }
  541. static void __exit exit_mbcache(void)
  542. {
  543. unregister_shrinker(&mb_cache_shrinker);
  544. }
  545. module_init(init_mbcache)
  546. module_exit(exit_mbcache)