Skip to content

Conversation

@nigoroll
Copy link
Member

Until now we kept failed objects momentarily on the LRU. This is wasteful, because they never get inserted into EXP (which happens via HSH_Unbusy() -> EXP_Insert), and as such will be removed from cache when the last reference goes away.

Why is this change correct?

  • in HSH_Lookup(), we explicitly skip OC_F_FAILED
  • the only place where OC_F_FAILED can be gained is HSH_Fail()
  • HSH_Fail() asserts that the object is still busy
  • LRU_Add() gets called via HSH_DerefBoc() -> ObjBocDone() when the boc's last reference goes away

Until now we kept failed objects momentarily on the LRU. This is wasteful,
because they never get inserted into EXP (which happens via HSH_Unbusy() ->
EXP_Insert), and as such will be removed from cache when the last reference goes
away.

Why is this change correct?

- in HSH_Lookup(), we explicitly skip OC_F_FAILED
- the only place where OC_F_FAILED can be gained is HSH_Fail()
- HSH_Fail() asserts that the object is still busy
- LRU_Add() gets called via HSH_DerefBoc() -> ObjBocDone() when
  the boc's last reference goes away
@bsdphk
Copy link
Contributor

bsdphk commented Dec 22, 2025

I think this is fine, but I think we should also add an assert in LRU_NukeOne() that nothing on the list has the OC_F_FAILED flag set, so document and enforce that new assumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants