Page 1 of 2

Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 6:47 am
by lordsnipe
Hello,

I've got a L1 and L2 cache setup, and it's set to prefetch on Windows startup. When I check Primocache, and Windows task manager just after startup, the prefetch line is running and slowly going up. Windows Task Manager shows 100% read on my HDD and not on my SSD?

The read speed at 100% according to task manager is about 120MB/sec. Is Primocache prefetching from L2 or the HDD?

I'm running 4.0.1.

Thanks.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 10:25 am
by Jaga
It's populating the L1 at boot, not the L2.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 12:23 pm
by lordsnipe
Yes, but shouldn't it populate L1 from L2 which is faster than the HDD? Windows task manager shows the HDD at 100% whilst prefetching so it looks like it's prefetching from the HDD. Otherwise I'd expect the SSD to show 100% instead on windows task manager.

The HDD when prefetching runs between 80 and 130MB/sec but my NVME SSD can theoretically do 2600MB/sec.

Surely if data is used enough to be considered L1 that it would also exist in L2 and can be fetched from there much faster than the HDD.....

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 1:04 pm
by lordsnipe
https://www.romexsoftware.com/en-us/pri ... cache.html

"Thus, PrimoCache can quickly provide needed data from level-2 cache and avoid fetching often-accessed data again from slow disks each time computer boots up."

Although the definitions page (https://www.romexsoftware.com/en-us/pri ... ation.html) states prefetch uses the underlying disk.

"Prefetch Last Cache: PrimoCache will load the last cache content from the underlying disk to the level-1 cache at next computer start up, in order to speed up the first data access."

I don't understand why it can't be prefetched from L2 though.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 3:22 pm
by InquiringMind
lordsnipe wrote: Fri Jan 15, 2021 1:04 pmI don't understand why it can't be prefetched from L2 though.
It could, but that relies on the L2 cache being current and correct (and there are a number of cases why this may not apply on system startup). Loading pre-fetch from the original data is the safest option and provides an extra opportunity for PrimoCache to check L2 (whether it actually does so is a question for Support).

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 8:10 pm
by Jaga
You're assuming that the L2 has a 100% copy of what was in the L1. To my knowledge they are allowed to keep different blocks in each, which would mean a L1 prefetch doesn't necessarily have to come from the L2.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Fri Jan 15, 2021 8:50 pm
by lordsnipe
Jaga wrote: Fri Jan 15, 2021 8:10 pm You're assuming that the L2 has a 100% copy of what was in the L1. To my knowledge they are allowed to keep different blocks in each, which would mean a L1 prefetch doesn't necessarily have to come from the L2.
Yes, my assumption is that the L1 is the mostly accessed blocks of L2, which is the mostly accessed blocks of the HDD. If data is important enough to be in L1 then it should also be in L2. Unless L2 was somehow smaller than L1 but not in my case (28GB L1 and 350GB L2).

It's taking just under 4.5 minutes to prefetch presumably from HDD, whereas 500MB/sec from SSD would be done in a minute.
InquiringMind wrote: Fri Jan 15, 2021 3:22 pm
lordsnipe wrote: Fri Jan 15, 2021 1:04 pmI don't understand why it can't be prefetched from L2 though.
It could, but that relies on the L2 cache being current and correct (and there are a number of cases why this may not apply on system startup). Loading pre-fetch from the original data is the safest option and provides an extra opportunity for PrimoCache to check L2 (whether it actually does so is a question for Support).
I don't think that's the reason why it fetches from the HDD. Primocache uses registry entries to determine if the L2 contents are out of date and also says offline modification of files is a no no.

https://www.romexsoftware.com/en-us/pri ... cache.html under "potential problem and notice"

Re: Primocache Prefetching from HDD and not SSD?

Posted: Sun Jan 17, 2021 12:24 pm
by janusz521
Another possible explanation that comes to mind is that the data formats used for L1 and L2 cache may be substantially different and sharing the same cache space may be rather complex. Also saving L1 would also affect the management of the L2 cache size as an L1 cache may be bigger than the target L2 cache.

Personally, I think that prefetch should not be set by default. It may be useful when someone is working with a specific set of applications all the time and wants them to run at full speed right after the boot. However quite often people work with different apps/games on every session so prefetch loads quite a lot of unneeded data that will be soon discarded. It may take some time too. In the case of an HDD drive, I suppose that prefetch may load some data from an L1 dump on HDD even if that data is also cached on a faster L2 cache.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Mon Jan 18, 2021 12:18 pm
by Support
Yes, currently PrimoCache prefetch data from underlying disks in order not to interfere L2. But we are considering to allow prefetch from L2 for better performance. Thanks.

Re: Primocache Prefetching from HDD and not SSD?

Posted: Mon Jan 18, 2021 11:36 pm
by lordsnipe
Thank you for the confirmation. I'd certainly be setting prefetch from L2 if that were an option.