Feature to populate L1 Cache if not full

Suggestions around PrimoCache
Post Reply
RobF99
Level 7
Level 7
Posts: 80
Joined: Fri Sep 19, 2014 5:14 am

Feature to populate L1 Cache if not full

Post by RobF99 »

It would be nice if there is an option so that if there is available space in L1 that it gets filled with the most eligible data from L2 that is not in L1.

When I say most eligible, I mean the data that would be last to be evicted from L2 if it was full. So it is the most recently used data from L2 that is in L2 but not in L1.

This is, in a way, like Superfetch in that it tries to fill all available L1 Cache (the fastest cache) with data that is not in it but likely to be used.

Since it is taking the data from SSD and not hard drive, it should not affect performance at all. You could do it either at the time of L2 gather interval or when idle or at some other appropriate schedule. Maybe at idle would be best.

This way the program gives the user an option for it to proactively to keep L1 populated for fastest performance always.

An alternate implementation or even an entirely new feature on top of that would be in the case where you did a big file copy which evicted all or most content from L1. After L2 gather for that big file that was read, you could then compare L2 to L1 contents and based upon your eviction algorithm, if certain L2 contents have a higher rank than the current L1 content, to then refill L1 with the better ranking data that is on L2. This way if one big file copy evicted all of the L1, that data would go back onto L1.

With these two options, the objective is to have L1, the fastest cache, always having the best ranking data on it and be used to its fullest potential capacity. This will further enhance performance for the user. They are both like a persistent prefetching.
TomB
Level 4
Level 4
Posts: 37
Joined: Wed Jul 29, 2020 11:15 pm

Re: Feature to populate L1 Cache if not full

Post by TomB »

+1
User avatar
Support
Support Team
Support Team
Posts: 3014
Joined: Sun Dec 21, 2008 2:42 am

Re: Feature to populate L1 Cache if not full

Post by Support »

In current design, when L1 has free space ( free > 64MB), PrimoCache will populate L2 data to L1 when this data is accessed.
Primo Ramdisk | PrimoCache
Romex Software Support
RobF99
Level 7
Level 7
Posts: 80
Joined: Fri Sep 19, 2014 5:14 am

Re: Feature to populate L1 Cache if not full

Post by RobF99 »

Yes I see that behavior work. That's good. It would just be nice to have an "option" to perform what I suggest above. It seems that you would already have the code because of prefetch. It just adds some proactive filling of L1 if user wants the option to. It also handles the situation where one big file copy takes up all of the L1 cache and might not be read again. I do understand that it does add further complexity but I think the tradeoff is worth it.
User avatar
Support
Support Team
Support Team
Posts: 3014
Joined: Sun Dec 21, 2008 2:42 am

Re: Feature to populate L1 Cache if not full

Post by Support »

We will consider this. But I'm afraid that this may not be implemented in near future because as you said it introduces complexity while we try to keep the program stable. Anyway, thank you for your suggestion!
Primo Ramdisk | PrimoCache
Romex Software Support
RobF99
Level 7
Level 7
Posts: 80
Joined: Fri Sep 19, 2014 5:14 am

Re: Feature to populate L1 Cache if not full

Post by RobF99 »

Ok, here is a way to somewhat support the situation where a user does a large file copy that evicts data from L1 cache. Add a right click option on a drive to "Rerun Last Prefetch". This way it doesn't add too much complexity and gives the user an option to repopulate L1 with the last prefetch in the event a large file copy evicts most data from L1 cache. I do understand that stability should be #1 priority. You do a great job there. Program is very stable!
User avatar
Support
Support Team
Support Team
Posts: 3014
Joined: Sun Dec 21, 2008 2:42 am

Re: Feature to populate L1 Cache if not full

Post by Support »

How to handle large files is one of our focus. Thank you very much for your idea!
Primo Ramdisk | PrimoCache
Romex Software Support
Post Reply