Skip to content

Commit

Permalink
DAOS-16488 common: more log message for LRU cache
Browse files Browse the repository at this point in the history
These message will help us to understand whether there is DRAM corruption.

Signed-off-by: Fan Yong <fan.yong@intel.com>
  • Loading branch information
Nasf-Fan committed Sep 27, 2024
1 parent 0dfe144 commit 7a79614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/common/lru.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ void
daos_lru_ref_release(struct daos_lru_cache *lcache, struct daos_llink *llink)
{
D_ASSERT(lcache != NULL && llink != NULL && llink->ll_ref > 1);
D_ASSERT(d_list_empty(&llink->ll_qlink));
D_ASSERTF(d_list_empty(&llink->ll_qlink),
"May hit corrupted item in LRU cache %p: llink %p, refs %d, prev %p, next %p\n",
lcache, llink, llink->ll_ref, llink->ll_qlink.prev, llink->ll_qlink.next);

lru_hop_rec_decref(&lcache->dlc_htable, &llink->ll_link);

Expand Down
7 changes: 4 additions & 3 deletions src/vos/vos_obj_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,19 @@ vos_obj_cache_create(int32_t cache_size, struct daos_lru_cache **occ)
{
int rc;

D_DEBUG(DB_TRACE, "Creating an object cache %d\n", (1 << cache_size));
rc = daos_lru_cache_create(cache_size, D_HASH_FT_NOLOCK,
&obj_lru_ops, occ);
if (rc)
D_ERROR("Error in creating lru cache: "DF_RC"\n", DP_RC(rc));
DL_CDEBUG(rc != 0, DLOG_ERR, DLOG_INFO, rc, "Create VOS object LRU cache %p, size %u",
*occ, 1 << cache_size);

return rc;
}

void
vos_obj_cache_destroy(struct daos_lru_cache *occ)
{
D_ASSERT(occ != NULL);
D_INFO("Destroy VOS object LRU cache %p\n", occ);
daos_lru_cache_destroy(occ);
}

Expand Down

0 comments on commit 7a79614

Please sign in to comment.