Are admission policies applied to objects (value changes in DRAM) even if they are read from the NVM cache?
Hello,
I have a question about admission policies that determine whether objects should be flushed to the NVM cache or not.
Assuming that admission policies do not exist, if objects are read from the NVM cache to DRAM and objects are overwritten in DRAM, they will be flushed to the NVM cache later (i.e., when objects are evicted from DRAM). However, if one of admission policies is applied to these objects so that they cannot be flushed to the NVM cache, users can finally read old data.
For this not to happen, are admission policies applied to objects that are not read from the NVM cache (i.e., isNVMClean() is false)?
I am not sure if I missed the source code, but currently, I cannot find the source code that prevents this (e.g., the source code that guarantees consistency).
I am not sure what do you mean by users can finally read old data. There is an updated version in the DRAM cache so it will always be returned by DRAM cache. The now dirty data in NVM is marked dirty and will never be used as an appropriate response for the given key. The function invalidateNvm is called which is found here.
@pbhandar2 Thank you for responding to my question.
What I was wondering is "what if the updated version in DRAM is not evicted to the NVM cache because of admission policy?"
To give an example:
- Object A was originally in the NVM cache.
- The user requests object A, but it does not exist in the DRAM cache. Thus, object A is fetched from the NVM cache.
- While object A is alive in the DRAM cache, it is updated.
- Updated object A is about to be evicted.
- Updated object A is not evicted to the NVM cache because of admission policy. Now, updated object A is discarded and the NVM cache still has old object A.
- When the user again requests object A, old object A from the NVM cache will be returned.
If I missed something, could you please elaborate more on this problem?
What you might be missing is that the moment the object that is in DRAM and also NVM updated in DRAM cache (Step 3), the item in NVM is invalidated and that item will no longer be useable. That means when the user requests object A (Step 6), it will be a miss and the item in NVM will not be returned.