L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

FAQ, getting help, user experience about PrimoCache
Post Reply
RobF99
Level 8
Level 8
Posts: 130
Joined: Fri Sep 19, 2014 5:14 am

L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by RobF99 »

Hello

I have 100% of my L1 Cache set to read only with L2 set to read and write but I notice that about 10% of my writes are to L1 cache. Why does this occur and is there a way around it? I want 100% of my writes to L2 only since I want all of my writes cached to L2 so they are cached to the SSD. L1 cache writes are not cached to the SSD and leave the cache if it gets full and they are evicted.

Can I also ask for a wishlist item here too... in a future version can you also give an option so that L1 writes are also flushed to L2 at the same time as they are flushed to the hard drive.

Thank you.
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by Support »

If Windows/Applications write data to disk sectors which were cached by L1 because of read, PrimoCache will still use these blocks and update cached contents. That's why you saw certain writes on L1 occurred even you set 100% read only.
We will fix this because logically this behavior is not correct.
RobF99 wrote: Thu Oct 24, 2019 10:23 am in a future version can you also give an option so that L1 writes are also flushed to L2 at the same time as they are flushed to the hard drive.
This might not be supported, but we are working to add an option so L1 writes will be flushed to L2 first.
RobF99
Level 8
Level 8
Posts: 130
Joined: Fri Sep 19, 2014 5:14 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by RobF99 »

Ok thank you. The proposed update where L1 write will be flushed to L2 first is perfect. It is the same result I am looking for which is caching writes on L2 - whether it happens simultaneously or L1 => L2 is fine by me.

PrimoCache is an amazing program. I have it on 5 PCs in my office and here on my main desktop I can enjoy 10 Tb of "cheap" traditional hard disk space and get SSD performance about 80% of the time. Why would I want to reduce my disk space with more expensive SSDs when I am almost getting the same performance anyway?!!

File use follows Pareto's law and that is 80% of the time you only use the same 20% of files over and over again and therefore the most important and frequently use files are usually cached always anyway.
RobF99
Level 8
Level 8
Posts: 130
Joined: Fri Sep 19, 2014 5:14 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by RobF99 »

In a way though it is nice to know that it is actually doing these updates to the L1 cache based upon the blocks being updated. Now that I know that is what it is doing I like that. Maybe leave it that way!
RobF99
Level 8
Level 8
Posts: 130
Joined: Fri Sep 19, 2014 5:14 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by RobF99 »

support wrote: Tue Oct 29, 2019 10:56 am If Windows/Applications write data to disk sectors which were cached by L1 because of read, PrimoCache will still use these blocks and update cached contents. That's why you saw certain writes on L1 occurred even you set 100% read only.
We will fix this because logically this behavior is not correct.
RobF99 wrote: Thu Oct 24, 2019 10:23 am in a future version can you also give an option so that L1 writes are also flushed to L2 at the same time as they are flushed to the hard drive.
This might not be supported, but we are working to add an option so L1 writes will be flushed to L2 first.
I think the most efficient way this should work is when L1 write data is evicted from cache it should be evicted to L2. This way you are not doing dual writes until they are needed and the L1 cached write data does make it to the L2 cache but not until it needs to be. The aim I think is to eventually have all data that is considered "cached" data will make its way onto L2 for if/when needed later. This is why Windows cache has the policy of read and write data be cached. Write data should be equally eligible to be cached because it may be needed later and was recently used.
RobF99
Level 8
Level 8
Posts: 130
Joined: Fri Sep 19, 2014 5:14 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by RobF99 »

RobF99 wrote: Fri Nov 01, 2019 3:04 pm This is why Windows cache has the policy of read and write data be cached. Write data should be equally eligible to be cached because it may be needed later and was recently used.
Actually, my quote here was wrong. Windows cache does seem to free cache space after lazy write so it appears that PrimoCache is able to serve a much better purpose than Windows because PrimoCache does indeed keep that write data in its cache unless you select free cache on written.
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by Support »

RobF99 wrote: Fri Nov 01, 2019 3:04 pm I think the most efficient way this should work is when L1 write data is evicted from cache it should be evicted to L2. This way you are not doing dual writes until they are needed and the L1 cached write data does make it to the L2 cache but not until it needs to be.
In most scenarios, this does. However, in scenarios where there are heavy writing IO requests, this strategy is not the best for the performance because it takes time to write L1 data to L2.
Anyway, we will consider all possible scenarios and provide more options. In future we may try to do a scenario detection and automatically switch to the best strategy.
Thanks for the suggestion.
bo3bber
Level 1
Level 1
Posts: 2
Joined: Thu Sep 13, 2018 2:27 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by bo3bber »

Not to put too fine a point on it, but you are using the terminology wrong here.

If L1 does not automatically propagate to L2, then it's not a multi-level cache, which is what the Level1 and Level2 cache would suggest. This is unnecessarily misleading.

I found this thread, because it seemed like it was not working correctly, where my 'L2' Write cache was not being used at all.

Words matter. Especially in technical fields. Your use of L1 and L2 here is incorrect.
Case in point- I thought it was broken, because it does not follow standard caching rules.
User avatar
Support
Support Team
Support Team
Posts: 3623
Joined: Sun Dec 21, 2008 2:42 am

Re: L1 Cache Writes Still Occur When R/W Cache Set to 100% Read

Post by Support »

Well, not exactly. For read caching, L1 is able to propagate to L2. For write caching, current strategy is to provide best write performance and throughput. However, in future versions, we will add an option to allow L1 writing propagating to L2.
Thank you for your comments.
Post Reply